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

Creatable: when promptTextCreator returns only the label, changes don't fire on first Enter key press #2140

Merged

Conversation

karaggeorge
Copy link
Contributor

@karaggeorge karaggeorge commented Nov 10, 2017

This PR solves this issue: #2125

Bug can be seen here: https://plnkr.co/edit/lC6lJuAYaTItCSJxTjnD?p=preview

Reason

It was caused because when creating a new choice, there is a check to see if the option is unique (even though there is a check for that to even display the new option creator). This check was checking the value against a list of filtered options. This filter was the passed down filter prop and was basically checking the option against itself with the addition of the prompt text. Therefore, by accident if there was a prompt text it was passing, but when using (label) => label, it was failing.

Solution

It has been fixed to check against the list of options available.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.586% when pulling a75d9ae on karaggeorge:prompt-text-creator-label-bug into 6cc59dd on JedWatson:master.

@karaggeorge karaggeorge changed the title Creatable: when promptTextCreator returns only the entered text, changes don't fire on first Enter key press Creatable: when promptTextCreator returns only the label, changes don't fire on first Enter key press Nov 10, 2017
@JedWatson
Copy link
Owner

Great, thanks @karaggeorge

👍 props for both the fix and explanation!

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.

None yet

3 participants