-
Notifications
You must be signed in to change notification settings - Fork 125
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
Conditions 629 Autocomplete Move Focus into List #33010
base: main
Are you sure you want to change the base?
Conversation
…WS a11y issue Replace onBlur with eventListener that closes list only if click outside container and add tabIndex so that focus can go on list items. Ensure any key press other than arrow up/down, enter, or escape, brings focus back to input. Add focus onMouseEnter so that highlight and focus are always aligned. Remove search onFocus functionality since this was firing with stale data whenever focusOnInput ran. Need to determine how to add back this functionality.
} | ||
}; | ||
|
||
document.addEventListener('mousedown', handleClickOutside); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll want to switch this to mouseup
so that users can change their mind about the action / cancel it. Check out this doc for more info: https://www.w3.org/WAI/WCAG21/Understanding/pointer-cancellation.html#dfn-down-event
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed with: b32cbf1
I tried canceling the action to test this change, but even moving the mouse out of the browser window still resulted in the list closing. I read this: "They normally receive visual feedback when an item is pressed. If they discover they have selected the wrong item, they can cancel the action by moving their pointer or finger away from the target before releasing." Are you able to cancel the action in the UI now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh sorry I got this one wrong, it would be mouse up when selecting the item. This is related to handleClickOutside.
Let's switch it back to mouse down 😅 Sorry!
Summary
Related issue(s)