-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix canvas iframe button accessibility and silent tab stops #59317
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +455 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
1d8068b
to
fab25e5
Compare
After probably WordPress/gutenberg#59317 made the editor iframe be considered a button labeled "Edit", a test started failing complaining about there being two such buttons: ``` locator.click: Error: strict mode violation: locator('body.block-editor-page').getByRole('button', { name: 'Edit', exact: true }) resolved to 2 elements: 1) <button type="button" aria-label="Edit" class="component…>…</button> aka getByLabel('Navigation').getByLabel('Edit') 2) <iframe tabindex="0" role="button" aria-label="Edit" nam…></iframe> aka locator('iframe[name="editor-canvas"]') ``` This fixes it by narrowing the search to the "Navigation" section of the page.
After probably WordPress/gutenberg#59317 made the editor iframe be considered a button labeled "Edit", a test started failing complaining about there being two such buttons: ``` locator.click: Error: strict mode violation: locator('body.block-editor-page').getByRole('button', { name: 'Edit', exact: true }) resolved to 2 elements: 1) <button type="button" aria-label="Edit" class="component…>…</button> aka getByLabel('Navigation').getByLabel('Edit') 2) <iframe tabindex="0" role="button" aria-label="Edit" nam…></iframe> aka locator('iframe[name="editor-canvas"]') ``` This fixes it by narrowing the search to the "Navigation" section of the page.
After probably WordPress/gutenberg#59317 made the editor iframe be considered a button labeled "Edit", a test started failing complaining about there being two such buttons: ``` locator.click: Error: strict mode violation: locator('body.block-editor-page').getByRole('button', { name: 'Edit', exact: true }) resolved to 2 elements: 1) <button type="button" aria-label="Edit" class="component…>…</button> aka getByLabel('Navigation').getByLabel('Edit') 2) <iframe tabindex="0" role="button" aria-label="Edit" nam…></iframe> aka locator('iframe[name="editor-canvas"]') ``` This fixes it by narrowing the search to the "Navigation" section of the page.
Fixes #47780
Fixes #51540
What?
In the Site editor, in view mode, the preview iframe behaves like a button to switch the editor to edit mode. That's mainly for keyboard interaction and screen reader users. However:
Why?
How?
role=button
:viewModeProps
toviewModeIframeProps
as those ar props for the iframe.Testing Instructions
Terminology reminder; the 'view mode' is the initial state fo the Site editor, the one that shows the navigation panel and the site preview.
edit-site-visual-editor__editor-canvas
:Testing Instructions for Keyboard
Screenshots or screencast