Skip to content

Conversation

@Francismb
Copy link

@Francismb Francismb commented Aug 5, 2019

focusDefaultOption prop

This prop enables or disables the automatically applied focus to the first or last option in the drop down menu of options.

The use case I found is that if you want a free text search select input but to also have auto completing options, much like a google search box.

#2848
#3324
#3484

@dko-slapdash
Copy link

Until this is merged, is there some work-around to achieve the same behavior? Like not focusing a menu item at all when the menu is opened due to a text match (except when an arrow-down is pressed).

@Francismb
Copy link
Author

Not that I have found @dko-slapdash

@ShonP
Copy link

ShonP commented Sep 19, 2019

@frazboyz thanks for this pr. please anyone merge when possible

@JedWatson
Copy link
Owner

Thanks for this @frazboyz, I'd be happy to merge this but could you please add an example demonstrating usage that we can use to test and demo how it works? (the "advanced" page probably the right place to do this)

@changeset-bot
Copy link

changeset-bot bot commented Oct 2, 2019

💥 No Changeset

Latest commit: 1b6c972

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

@Francismb
Copy link
Author

All yours @JedWatson Example added to the advanced section.

@dannnylin
Copy link

@JedWatson can we please merge?

@dannnylin
Copy link

@gwyneplaine

@marcolazzarini
Copy link

Is the version containing this fix already released?

@dannnylin
Copy link

@JedWatson @gwyneplaine

@marcolazzarini
Copy link

marcolazzarini commented Dec 5, 2019

Let me say that this feature is fundamental in order to use react-select as base for an action menu, like:

Screenshot 2019-12-05 at 08 41 03

in this kind of situation, it's weird (and basically wrong) to have any of the options automatically focused opening the menu

@Francismb
Copy link
Author

@mitchellhamilton Any chance you can take a final look?

@eugenet8k
Copy link
Contributor

Please submit, this is a helpful compromise for another use case. If isMulti={true} and closeMenuOnSelect={false} I want users to be able to select multiple options one by one. At this moment, each time users select an option it disappears from options hence getNextFocusedOption mandatory will focus first or last one.

Having focusDefaultOption={false} would at least fix the UX for mouse users, as a nearby to the previously selected option will be focused due to mouse hover event. For keyboard users, it won't help though...

@Francismb Francismb requested a review from gwyneplaine January 15, 2020 19:40
@diegosps
Copy link

@flexdinesh pinging you because I saw the pinned issue.

You can see from the linked issue and pr, this has been requested multiple times and it is a longin waiting bug fix.

@bladey bladey added pr/needs-review PRs that need to be reviewed to determine outcome pr/priority PRs that should be addressed sooner rather than later and removed ready-for-review labels May 26, 2020
@bladey bladey removed the request for review from gwyneplaine June 10, 2020 02:56
@bladey
Copy link
Contributor

bladey commented Jun 10, 2020

Thanks for your contribution @Francismb!

This PR has now been brought up to date and tweaked so it can be merged - see PR #4080 for more details.

Closing this PR in favor of #4080.

@bladey bladey closed this Jun 10, 2020
@raulhinojosa
Copy link

Anybody found a workaround at least?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr/needs-review PRs that need to be reviewed to determine outcome pr/priority PRs that should be addressed sooner rather than later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants