Skip to content

Disable auto focus for option #2848

Closed

Description

@khawerrind

First of all thank you for the great library.

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.

Activity

  1. tung-dang commented on Aug 1, 2018

    @tung-dang

    In this code line https://github.com/JedWatson/react-select/blob/master/src/Select.js#L458, look like
    focusOption is 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".

  2. software-project commented on Oct 17, 2018

    @software-project

    Anyone found a solution for this?

  3. yurii-lubynets commented on Jul 21, 2019

    @yurii-lubynets

    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

  4. alisman commented on Jan 8, 2020

    @alisman

    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.

  5. manvydasu commented on Jan 30, 2020

    @manvydasu
    Contributor

    There is an approved PR for this - #3010

  6. added
    pr/needs-reviewPRs that need to be reviewed to determine outcome
    on Jun 1, 2020
  7. added
    issue/bug-confirmedIssues about a bug that has been confirmed by a maintainer
    and removed
    pr/needs-reviewPRs that need to be reviewed to determine outcome
    on Jun 10, 2020
  8. bladey commented on Jun 10, 2020

    @bladey
    Contributor

    This will be resolved when #4080 is merged.

  9. added
    pr/in-reviewPRs currently in review by maintainers for the next release
    issue/reviewedIssue has recently been reviewed (mid-2020)
    and removed
    issue/bug-confirmedIssues about a bug that has been confirmed by a maintainer
    pr/in-reviewPRs currently in review by maintainers for the next release
    on Jun 10, 2020
  10. added
    issue/has-prIssue has a PR attached to it that may solve the issue
    on Jul 6, 2020
  11. added
    menu-bugAddresses menu positioning, scrolling, or general interactions
    on Jun 10, 2021
  12. augusto-proano commented on Dec 3, 2021

    @augusto-proano

    @khawerrind, quick question, are you planning to merge this pr at some point?

  13. Repository owner locked and limited conversation to collaborators on Oct 31, 2022
  14. converted this issue into a discussion #5447 on Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/has-prIssue has a PR attached to it that may solve the issueissue/reviewedIssue has recently been reviewed (mid-2020)menu-bugAddresses menu positioning, scrolling, or general interactions

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions