-
Notifications
You must be signed in to change notification settings - Fork 932
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
Default / Initial value for downshift #665
Comments
Hello @rjuszkiewicz have you tried using the |
@silviuavram , I've tried defaultSelectedItem as Downshift prop. Could you add an example how to use iinitialSelectedItem? |
can you please read our documentation? it's the reason why it is there. and it has all the information you needed to fix your problem in less than 5 minutes. there is no Is it clear now? :) |
I know this is closed, but https://github.com/downshift-js/downshift/blob/master/flow-typed/npm/downshift_v2.x.x.js.flow#L51 |
Both |
Hi @silviuaavram, I think you might have been mistaken here. |
Then it should probably be removed from the types. However, it is used in Thanks for pointing this out! |
In case if someone is looking to set initial value for input field you get use initialInputValue regardless of available option in items heres a code example
|
I can't see any mention of initialSelectedItem or defaultSelectedItem in the docs? It'd be very useful to know what is the difference between them and how to use them in useSelect, which has both. |
https://github.com/downshift-js/downshift/tree/master/src/hooks/useSelect#advanced-props Initial means the value is used at initial render. Default means the value is used at initial render + after each selection / reset. |
Ah thanks! BTW I was looking at the docs that come up in a web search for Downshift: https://www.downshift-js.com/use-select/ |
We can add links to the github page labelled as full documentation. Will keep this issue open. It needs to land in https://github.com/downshift-js |
I'm using downshift 3.0.0
How to set the initial default value ?
My code:
The text was updated successfully, but these errors were encountered: