#108993context menu: lost focus after ESC
Description
In the TYPO3 backend, when opening the context menu from a tree structure (e.g. page tree) and closing it via the ESC key, the keyboard focus jumps to the top of the page (or another item before) instead of returning to the triggering tree item.
This breaks efficient keyboard usage and is problematic from an accessibility perspective.
Steps to Reproduce
- Log into the TYPO3 backend.
- Navigate to the page tree (or any tree structure that provides a context menu).
- Focus a tree item
- Open the context menu for this item
- Press ESC to close the context menu.
- Check where the keyboard focus is now located (press TAB once).
Current Behavior
After pressing ESC, the context menu closes, but the focus moves to the top of the page or is no longer on the previously focused tree item.
Expected Behavior
After pressing ESC, the context menu is closed and the keyboard focus returns to the triggering tree item (or, more generally, to the triggering UI element).
Impact
- Keyboard and screen reader users lose their position in the backend tree and have to re-navigate to the desired node.
- Increased navigation time and frustration for heavy keyboard users.
- Violates common accessibility and focus management patterns (incl. WCAG 2.1 focus order recommendations).
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[BUGFIX] context menu: lost focus after ESC Resolves: #108993 Releases: main