Skip to content

fix: improve focus management of the select after picking an option - #4262

Merged
AlexAndBear merged 1 commit into
mainfrom
fix/select-mouse-pick-focus
Nov 6, 2026
Merged

AlexAndBear merged 1 commit into
mainfrom
fix/select-mouse-pick-focus

Conversation

@AlexAndBear

Copy link
Copy Markdown
Member

Description

Picking an option with the mouse now keeps the focus in the select, the same as with the keyboard and like a native select does, so the next Esc or Tab doesn't end up on the page (e.g. Esc no longer closes "Edit user" and drops the changes). After a touch pick the focus is released so the soft keyboard closes, which is how other select implementations like react-select handle it.

Related Issue

How Has This Been Tested?

  • test environment: unit tests (Vitest), browser tests (Playwright) against a local OpenCloud
  • test case 1: unit: mouse and keyboard picks keep the focus in the select and leave the list closed
  • test case 2: unit: one click on the caret or the selected label reopens the list after a pick
  • test case 3: unit: a touch pick releases the focus, a later pick without its own touch keeps it
  • test case 4: unit: focus moved elsewhere by the pick is not taken back
  • test case 5: browser: Edit user, change the name, pick a role with the mouse, Esc keeps the panel and the changes (reproduced on main first)
  • test case 6: browser: reopening, typing and Tab after a pick, multiple select, select in a modal, tags in the sidebar
  • test case 7: browser: Pixel 7 tap pick releases the focus and the list reopens on tap

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@AlexAndBear
AlexAndBear merged commit ffca652 into main Nov 6, 2026
29 checks passed
@AlexAndBear
AlexAndBear deleted the fix/select-mouse-pick-focus branch November 6, 2026 09:09
@openclouders openclouders mentioned this pull request Nov 6, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Picking a select option with the mouse moves focus out of the select

2 participants