refactor: extract popover focus management into a controller#11535
refactor: extract popover focus management into a controller#11535web-padawan merged 1 commit intomainfrom
Conversation
DiegoCardoso
left a comment
There was a problem hiding this comment.
Should it have a .d.ts file?
Move Tab/Shift+Tab routing and its helpers from vaadin-popover.js into a new PopoverFocusController. The controller models a "logical" tab order by moving the popover from its DOM position to right after its target, which collapses the previous branching cases into straightforward next/prev lookups against that list. Behavior is preserved; all existing a11y and dialog-popover integration tests continue to pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d188c66 to
5d35f81
Compare
Added. |
|
|
Hi @web-padawan and @web-padawan, when i performed cherry-pick to this commit to 24.10, i have encountered the following issue. Can you take a look and pick it manually? |
|
This ticket/PR has been released with Vaadin 25.2.0-alpha4. |



Summary
vaadin-popover.jsinto a newPopoverFocusController(packages/popover/src/vaadin-popover-focus-controller.js).vaadin-popover.jsshrinks by ~230 lines; the focus logic becomes isolated in preparation for the opt-in API for Prevent TAB going into Popover [2 days] #11423.Behavior is preserved: modal popovers still rely on the overlay's own focus trap, and the controller cooperates with
FocusTrapControllerwhen the popover lives inside one (e.g. a dialog).Test plan
yarn test --group popover— 322 testsyarn test:it— 412 integration tests (includesdialog-popover.test.jstrap-wrap scenarios)yarn lint:jsandyarn lint:types🤖 Generated with Claude Code