-
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
iFrame: Sometimes focus is lost with the Page List block in navigation mode #47333
Comments
@t-hamano I saw you tested my previous issue, can you give this one a look please? Interested to see if other Windows users can replicate. Thanks. |
Thanks for pinging me 👍 From what I have tested, this may be a problem with the page list block. This problem can be reproduced by the following procedure:
I have tested it on several blocks and so far it seems to occur only in the Page List block. Posts.gutenberg.WordPress.-.Google.Chrome.2023-01-23.13-20-48.online-video-cutter.com.mp4@alexstine |
@t-hamano This is because Gutenberg does not properly handle screen reader modes for Windows. When you switch in to navigation mode, you probably heard a tone. Press your NVDA modifier key plus space bar to switch in to edit mode. Edit mode sounds like a typing sound. If NVDA is in browse mode, you are getting a virtual view of the DOM and Gutenberg keyboard events do not fire. If you switch to edit mode, Gutenberg manages everything for the screen reader. The problem that has been around from the beginning, NVDA does not know which mode to be in. Anyway, that is a much larger discussion for later. Hope this helps. |
@alexstine |
I have looked into this issue further and believe it is a problem specific to the page list block. The page list block has the following structure: <ul tabindex="0" class="block-editor-block-list__block wp-block wp-block-page-list is-selected wp-block-page-list block-editor-block-list__layout" id="block-XXXXX" role="document" aria-label="Block: Page List" data-block="XXXXXX" data-type="core/page-list" data-title="Page List">
<li class="wp-block-pages-list__item"><a class="wp-block-pages-list__item__link">Page 1</a></li>
<li class="wp-block-pages-list__item"><a class="wp-block-pages-list__item__link">Page 2</a></li>
<li class="wp-block-pages-list__item"><a class="wp-block-pages-list__item__link">Page 3</a></li>
</ul> The In navigation mode, pressing the right key on a page list block is considered to navigate into a child block: gutenberg/packages/block-editor/src/components/block-tools/block-selection-button.js Lines 166 to 170 in 4f94f09
Then it tries to select a child block at the following point, but fails to select the block, probably because the gutenberg/packages/block-editor/src/components/block-tools/block-selection-button.js Lines 197 to 199 in 4f94f09
I can't come up with any specific code to solve this, but perhaps we should add a process to not focus the child block unless it is an operable block. |
@t-hamano Surely there is a way we can check if the element is focusable. I really cannot wait to do away with block selection button and just rely on the list view as it does not suffer from these problems. Maybe even hardcoding a check specific to the page list block would be okay but need to do something to fix the UX here. I think this has improved in other parts of the editor, I know in the list view, focus is only attempted if the element can receive focus. I do not think this should be refactored but quick fix would be great. Thanks. |
The editor is getting closer but I am still struggling with how to properly implement this. More issues will come once I finally figure out a good approach to handling Gutenberg native keyboard events and screen readers. It is worth noting that this is not a Mac problem as screen reader on Mac co-exists with the OS. Hard to pass any blame to Gutenberg devs who tested with Mac only expecting everything to be fine. Mac vs. Windows is a whole other discussion... |
Doing a sweep of high priority labels and am removing the label from this issue as, from what I'm reading, this is isolated to the Page List block and touches on a broader navigation mode experience, which touches on a larger convo around consolidating/prioritizing list view instead. I've renamed the issue to help make this issue a bit more actionable for now and want to note it for @getdave as the navigation block efforts continue. |
Description
When in navigation mode, sometimes the focus is completely lost from the block select button. This needs a fix as it looks like this bug impacts all keyboard users and is not specific to screen readers alone.
Added a video this time so I could catch it in the act. Not sure if this is a regression or an outstanding issue. Needs a fix anyway.
Step-by-step reproduction instructions
document.activeElement;
Screenshots, screen recording, code snippet
Video below.
video1433604524.mp4
Environment info
Gutenberg: trunk
Firefox and Google Chrome: latest
OS: Windows 10 Professional
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: