You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to ask if there is any option to not select any option by default? I want the option to be selected only when user use arrow keys or click on an option using mouse.
Hello, @JedWatson
Thank you for the flexible and useful tool. Could you provide some hardcoded solution for this issue? And what about the autoFocus prop?
Thanks,
Yurii
Activity
tung-dang commentedon Aug 1, 2018
In this code line https://github.com/JedWatson/react-select/blob/master/src/Select.js#L458, look like
focusOptionis always the first or last menu option.I am also looking for a way to disable this behaviour - "auto select an option when menu open".
software-project commentedon Oct 17, 2018
Anyone found a solution for this?
yurii-lubynets commentedon Jul 21, 2019
Hello, @JedWatson
Thank you for the flexible and useful tool. Could you provide some hardcoded solution for this issue? And what about the
autoFocusprop?Thanks,
Yurii
alisman commentedon Jan 8, 2020
While it would be great for this PR to be merged, I believe I managed to accomplish this with the following hackery:
onInputChange={(value: string) =>{ this.selectRef.select.getNextFocusedOption = ()=>null; }}
There is no longer any default selection, but arrow keying still works.
I then also bind to onKeyDown to intercept submission from input and fire submission callback with text directly from input.
manvydasu commentedon Jan 30, 2020
There is an approved PR for this - #3010
bladey commentedon Jun 10, 2020
This will be resolved when #4080 is merged.
augusto-proano commentedon Dec 3, 2021
@khawerrind, quick question, are you planning to merge this pr at some point?