Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Playground block: a11y: Avoid lost focus due to activation (#338)
## What, why, and how? Before this PR, clicking the Activate Live Preview button loses the focus because the button disappears as soon as it is clicked. This is not good for accessibility. This PR updates the block to move focus to a meaningful location, the "Beginning of Playground Preview" marker, when the Activation button is clicked. Related to #290 ## Testing Instructions Because the Beginning of Playground Preview marker is not actually shown when focused, I tested via the following dance: - Open a post with a Playground block that requires activation - Open the dev tools console - Run the following in the console: `setTimeout(() => console.log(document.querySelector(':focus')), 2000)` - Click the Activate Live Preview button before the timeout - Observe that the before-preview marker is logged as having the focus
- Loading branch information