Add onBlurResetsInput prop - #591
Conversation
slybridges
commented
Nov 30, 2015
@JedWatson - anything you'd need from me to get this merged ? |
CodeWiesel
commented
Dec 1, 2015
I would love this feature as well Anytime soon we can expect this? |
alurim
commented
Jan 12, 2016
+1 this would be great to have |
JedWatson
commented
Jan 13, 2016
Thanks for the bump - sorry I left it so long! and thanks for the PR @slybridges :) |
fhelwanger
commented
Jan 18, 2016
Great! Sorry to ask this... but do you know when this will be available on npm? We really need this feature to our app. |
JedWatson
commented
Feb 12, 2016
In about 15 minutes. |
fhelwanger
commented
Feb 12, 2016
Thanks! I'll update our project. We're using a custom build until now :) |
frodrigueza
commented
Apr 6, 2016
Is this available on npm? We need this feature a lot! Thanks! |
JedWatson
commented
Apr 6, 2016
@frodrigueza it's been available since version |
frodrigueza
commented
Apr 6, 2016
Ok, thanks @JedWatson . |
Hello, I see Can someone provide an example of how to achieve the equivalent effect of Edit: Found it: https://react-select.com/advanced#controlled-props |
gitowiec
commented
Sep 2, 2020
I wonder why this works wrong. If I connect |
Shreyam-Saha
commented
Dec 10, 2020
@samism Hey what about if I am using a functional Component ? How can I write the onInputChange method ? |
ebonow
commented
Dec 10, 2020
Greetings @Shreyam-Saha @gitowiec // onBlur => setInputValue to last selected valueif(action==="input-blur"){setInputValue(value ? value.label : "");}// onInputChange => update inputValueelseif(action==="input-change"){setInputValue(inputValue);}to this: // onBlur => keep input valueif((action==="input-blur")||(action==="input-change")){setInputValue(inputValue);}``` |
Shreyam-Saha
commented
Dec 15, 2020
@ebonow This does not solve the issue. The text typed in the field goes away once I click away, I want it to stay |
Methuselah96
commented
Dec 15, 2020
@Shreyam-Saha What issue are you trying to solve? This PR is about making the text go away when you click away, which is why that's the assumption of the issue you're trying to solve. The CodeSandbox provided shows you how to write an Finally, it would be appreciated if you don't down-vote people who are trying to help you. While @ebonow might not have answered the question the way you wanted him to, he has taken the time (out of his free time) to try to help you out. If someone responds to you and they didn't answer your question, it's better to just clarify your question, thank them for you helping you, and not down-vote them. |
Shreyam-Saha
commented
Dec 15, 2020
@Methuselah96 really sorry if I sounded rude. |
Add an
onBlurResetsInputprop that, if set tofalse, would keep user input in search box ononBlur.Defaults to
true.Fixes#588