-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Allow create option when there are matches #606
Conversation
There was a problem hiding this 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
src/select-panel/index.tsx
Outdated
{isCreatable && canCreatableAppear ? ( | ||
<li | ||
onClick={handleOnCreateOption} | ||
className="select-item creatable" | ||
tabIndex={skipIndex === 1 ? 0 : 1} | ||
ref={creationRef} | ||
> | ||
{`${t("create")} "${searchText}"`} | ||
</li> | ||
) : null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
src/select-panel/index.tsx
Outdated
<li className="no-options">{t("noOptions")}</li> | ||
)} | ||
</ul> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SelectPanel; | ||
export default SelectPanel; |
There was a problem hiding this comment.
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
src/select-panel/index.tsx
Outdated
@@ -215,23 +228,18 @@ const SelectPanel = () => { | |||
disabled={disabled} | |||
/> | |||
)} | |||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Updated. Let me know if there is anything else |
Going to make some more changes to this so merging it into secondary branch |
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 |
@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? |
Addresses #529
Nice library :) Good job