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

Awkward navigation of AutoComplete when defaultActiveFirstOption=false and no values are selected #16572

Closed
1 task done
ymzong opened this issue May 13, 2019 · 3 comments · Fixed by react-component/select#402
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug. 👷🏻‍♂️ Someone working on it

Comments

@ymzong
Copy link

ymzong commented May 13, 2019

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

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Route 1):

  • Enter "foo" into the AutoComplete bar
  • Press enter without selecting the matching "foo" option in the dropdown

Route 2):

  • Enter "apple" into the AutoComplete bar
  • Press enter without selecting any options in the dropdown

What is expected?

The outer form should be submitted, thereby alerting "submit" to the browser in the demo.

My rationale: Even though no options are selected in the dropdown, if the user enters some text and hits enter, s/he should expect AutoComplete to actually use the value and proceed to submit the form.

What is actually happening?

Nothing happens since no option is selected.

Environment Info
antd 3.18.1
React 16.8.6
System Windows
Browser Chrome

This glitch only occurs when defaultActiveFirstOption={false} because otherwise the first match always gets selected by default. Current workaround is for user to press Esc after entering the keyword and then press Enter, but I don't think that's ideal...

@afc163
Copy link
Member

afc163 commented May 14, 2019

similar with #14544 and #10861

@afc163 afc163 added the 🐛 Bug Ant Design Team had proved that this is a bug. label May 14, 2019
@zombieJ
Copy link
Member

zombieJ commented May 14, 2019

Hmmm... seems close prevented by empty selection. It should adjust.

@ymzong
Copy link
Author

ymzong commented May 14, 2019

Thanks for the quick turnaround @zombieJ @afc163!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug. 👷🏻‍♂️ Someone working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants