-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
onCreateOption is not called, fails at valueArray[valueArray.length - 1] === newOption
#3988
Comments
I can confirm. Works in 3.0.8, stopped working in 3.1.0. |
Created a reproducible: https://codesandbox.io/s/magical-margulis-xm9x3 |
@gwyneplaine Please check out the fix and tell me what you think. I've ran the tests and did some manual testing on the docs page - everything seems to be fine. I'd be happy to add a test, but I'll need a little guidance. |
@JedWatson @gwyneplaine Friendly ping :) |
I also just hit this. |
@JedWatson @gwyneplaine Hi there! How should we proceed on this PR? :) |
We also encountered this bug, and can confirm @nikitaindik PR will fix the problem. |
Thanks all, I'll try and get the PR reviewed as soon as I can. |
For anyone struggling with this in the interim, you can use the Ex:
|
It's pretty disappointing this regression has not been fixed despite being reported 6 months ago - should we start moving away from react-select? |
@jonfreedman Given the most recent conversation in #3910 and the clear lack of a response, I think it might be inevitable. I might start working on a fork that fixes the most urgent issues. |
EDIT: 🎉 I've archived the fork now that we've got some momentum in this repo and Jed is involved again. Sorry for the disturbance! |
Your solution works for us, but I've spent ages and can't understand why it "busts the equality check"... Can you please explain? I tried replacing |
Can someone provide a sandbox with an example of this not working? I'm still investigating @nikitaindik's CodeSandbox, but from what I can tell that only breaks when you don't enter any text into the input, and it sounds like other people were having trouble even when there was text in the input. I'm trying to pin down the root issue. Thanks! EDIT: Never mind, I've been able to pin down the root issue. Looking at the proposed changes now. |
Getting a weird bug at this line.
react-select/packages/react-select/src/Creatable.js
Line 148 in c8d74bd
It seems that the
===
comparison fails on this line.I put debugger breakpoint and inspected the values. Please see the console output.
It looks like the
newOption
andnewValue
have the same content by they fail when compared using===
operator. As the result theonCreateOption
is not called.The text was updated successfully, but these errors were encountered: