Skip to content

fix(Dropdown): return focus to the toggle when the menu closes from inside it - #329

Merged
xidedix merged 1 commit into
v5.7from
fix/dropdown-menu-close-focus
Oct 26, 2026
Merged

xidedix merged 1 commit into
v5.7from
fix/dropdown-menu-close-focus

Conversation

@xidedix

@xidedix xidedix commented Oct 26, 2026 •

Copy link
Copy Markdown
Member
  • item, cDropdownClose, click in the menu, close from code: focus goes back once the menu was used
    since it opened (focusin, pointerdown or keydown in it) and the window has focus
  • only when focus is in the menu, on the body or nowhere; focus moved elsewhere stays
  • after the render, as program focus, without scrolling; Escape still scrolls
  • after a touch or pen in the menu, text inputs, textareas and contenteditable targets are skipped
  • a repeated Enter on the toggle or a control inside it is ignored
  • internal DropdownFocusReturn token, given in viewProviders and injected with host, names the
    targets for the dropdown in a component's own template
  • restoreFocus: optional focus function, focus read in the root of the overlay and of the target

…nside it

- item, cDropdownClose, click in the menu, close from code: focus goes back once the menu was used
  since it opened (focusin, pointerdown or keydown in it) and the window has focus
- only when focus is in the menu, on the body or nowhere; focus moved elsewhere stays
- after the render, as program focus, without scrolling; Escape still scrolls
- after a touch or pen in the menu, text inputs, textareas and contenteditable targets are skipped
- a repeated Enter on the toggle or a control inside it is ignored
- internal DropdownFocusReturn token, given in viewProviders and injected with host, names the
  targets for the dropdown in a component's own template
- restoreFocus: optional focus function, focus read in the root of the overlay and of the target
@xidedix
xidedix merged commit 5d26ba6 into v5.7 Oct 26, 2026
9 checks passed
@xidedix
xidedix deleted the fix/dropdown-menu-close-focus branch October 26, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant