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

TAB keyup should be ignored/not trigger ajax request & dropdown #114

Open
micschk opened this issue Apr 14, 2021 · 3 comments
Open

TAB keyup should be ignored/not trigger ajax request & dropdown #114

micschk opened this issue Apr 14, 2021 · 3 comments
Assignees
Labels
Milestone

Comments

@micschk
Copy link

micschk commented Apr 14, 2021

Currently when using the tab-key to cycle through form-fields, upon focussing on an autocomplete-field which already has a value, the TAB keyup event on that field will trigger the ajax call & dropdown for that field.

IMO autocomplete should not be triggered by a TAB keyup as that's typically used to jump from one field to another.

@xcash
Copy link
Owner

xcash commented Apr 14, 2021

TAB confirms the item selected in the autocomplete.
I need to investigate these edge cases to prevent some bad behavior.

@xcash xcash self-assigned this Apr 14, 2021
@xcash xcash added the bug label Apr 14, 2021
@xcash xcash added this to the Future milestone Jun 18, 2021
@machinehum
Copy link

machinehum commented Aug 26, 2021

This isn't related to TAB confirming the item selected in the autocomplete. This is TAB triggering handlerTyped (via falling through to the 'default' in the keyUp switch statement around line 250) when the user tabs into or out of an input, which fundamentally breaks the behavior of html forms (and is also very bad for accessibility). The user does not expect a search to happen and a dropdown to show up for a field they've already tabbed away from, or for a search to happen on the extant value for a field that they tab into.

You just need to add a 'case 9:' with no action in the 'switch' that starts on line 252 in main.ts. Tested this locally and confirmed it fixes this issue and does not affect the dropdown.

@machinehum
Copy link

Pull request opened (128).

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

No branches or pull requests

3 participants