Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow create option when there are matches #606

Merged

Conversation

jose-donato
Copy link
Contributor

Addresses #529

Nice library :) Good job

Copy link
Member

@harshzalavadiya harshzalavadiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jose-donato thanks, this is awesome,

Just few more changes are required, here's patch if you want to just update your PR Directly

rmsc-creatable.patch.txt

src/select-panel/index.tsx Show resolved Hide resolved
Comment on lines 210 to 219
{isCreatable && canCreatableAppear ? (
<li
onClick={handleOnCreateOption}
className="select-item creatable"
tabIndex={skipIndex === 1 ? 0 : 1}
ref={creationRef}
>
{`${t("create")} "${searchText}"`}
</li>
) : null}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • instead of keeping this on top I would like to follow what react-select does and keep it last instead of first
  • this way we can remove a lot of clutter here keeping old layout so null on like 237 will be replaced with same component
    Screenshot 2022-06-03 at 9 47 59 PM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also instead of using turnery operator + null you can just use && operator

<li className="no-options">{t("noOptions")}</li>
)}
</ul>
</div>
);
};

export default SelectPanel;
export default SelectPanel;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also please restore empty line here as it was earlier

@@ -215,23 +228,18 @@ const SelectPanel = () => {
disabled={disabled}
/>
)}

Copy link
Member

@harshzalavadiya harshzalavadiya Jun 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please restore this empty line removed here as well

Copy link
Contributor Author

@jose-donato jose-donato Jun 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry vs code auto formatter

@jose-donato
Copy link
Contributor Author

jose-donato commented Jun 3, 2022

Updated. Let me know if there is anything else

@harshzalavadiya harshzalavadiya changed the base branch from master to feat-cleanup June 8, 2022 08:01
@harshzalavadiya
Copy link
Member

Going to make some more changes to this so merging it into secondary branch

@jose-donato
Copy link
Contributor Author

Hey, i found an issue with this though. since the library only checks if number of options selected match the number of options that exist.

Imagine there are 4 options initially, if the user creates another 4 and select those it will say "All options selected". can create an issue with this

@harshzalavadiya
Copy link
Member

@jose-donato Yes, I think that can create an issue.

If it's not too much to ask can you provide a reproduction in new Issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants