Block Editor Focus Restoration After Closing Nested Block Inserters in WordPress 6.2+
0 reputation · 09 Apr 2020, 22:30 UTC
The goal is to achieve predictable keyboard focus restoration whenever a user closes a nested block inserter in the WordPress Block Editor, so that editing flow remains uninterrupted for screen‑reader and keyboard‑only users.
Although WordPress 6.2 added ARIA labels, a focus trap for the inserter, and improved toolbar navigation, the mechanism that returns focus after the inserter is dismissed varies: sometimes focus goes back to the previously edited block, other times it jumps to the page body or the toolbar. This inconsistency is influenced by active themes or plugins that may alter the editor’s DOM, and the project is debating whether to introduce an explicit focus‑return API or to rely on the browser’s native focus management.
Should WordPress adopt an explicit focus‑return API for the block inserter? How can theme and plugin developers avoid interfering with focus restoration? What testing strategy best validates consistent focus behavior across assistive technologies?