You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Picking a select option with the mouse moves focus out of the select #4256
I understand this is a bug report and questions should be posted in the Community Discussions
I searched issues and couldn’t find anything (or linked relevant results below)
Bug Description
When you pick an option in an OcSelect with the mouse, focus leaves the select and ends up on <body>. Picking with the keyboard (Enter) keeps focus in the select, because OcSelect puts it back on the search input, but the mouse pick doesn't: vue-select blurs the input after a pick and nothing refocuses it.
That's an accessibility problem (WCAG 2.4.3 Focus Order): screen readers in browse mode activate options with a click, so their users lose their place in the form after every pick. It also breaks keyboard shortcuts: with focus on <body>, the next Esc goes to the page-level shortcuts instead of the select. In "Edit user" in the admin settings, that Esc clears the user selection and closes the edit panel, and all unsaved changes are lost without a warning.
Reproduction Steps
Admin settings > Users: edit a user
Change the name
Open the role dropdown with the mouse and click another role
Press Esc
Expected Outcome
Focus stays in the select after a mouse pick, the same as after a keyboard pick. Esc doesn't close the panel, and the changes are kept.
Actual Outcome
Focus is on <body> after step 3. Esc clears the selection, the edit panel closes and the name change is lost.
Activity