Skip to content
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

Down arrow on a <Select> component will open the drop-down but not select the first option #26877

Closed
1 task done
cuibonobo opened this issue Sep 24, 2020 · 2 comments
Closed
1 task done

Comments

@cuibonobo
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Once the example has completely loaded, the select element should be automatically focused. Hit the down arrow on the keyboard to open the drop-down.

What is expected?

The first option should be selected when the drop-down opens by hitting the down arrow.

What is actually happening?

The drop-down opens, but the first option is not selected.

Environment Info
antd 4.6.5
React 16.13.1
System Windows 10
Browser Firefox 80.0.1

The Select element requires that you press the down arrow twice in order to select the first option. This is not consistent with the default HTML select element. In addition, hitting the Tab key does not select the currently highlighted option, but this is a separate issue: #26876.

@afc163
Copy link
Member

afc163 commented Sep 25, 2020

@afc163 afc163 closed this as completed Sep 25, 2020
@cuibonobo
Copy link
Author

Thanks for providing a solution, but the documentation for defaultActiveFirstOption says that the default value for this option is true. If that were the case, the desired behavior would happen by default without needing to specify the option.

It seems to me like there is still a bug: either the default behavior for defaultActiveFirstOption is incorrect, or the documentation should list the default value as false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants