Skip to content

Navigation page: the "Currently editing" select element should not trigger a page re-render on change #25312

Closed

Description

@afercia

Describe the bug

In the new Navigation page, the "Currently editing" select element triggers a page re-render when the change event fires. This is a known accessibility barrier as changes of context should always happen on explicit user activation. Worth reminding this behavior is dangerous especially on Windows, where the select elements options can be changed even keeping the select closed. For more details, please refer to this Trac ticket:

Review the usage of the change event on select elements
https://core.trac.wordpress.org/ticket/40925

The WCAG guidelines explicitly state to provide a submit button to initiate a change of context.

Also, worth noting the current Menus page does have a button to submit the select element changed value, and for good reasons:

Screenshot 2020-09-14 at 19 28 47

To reproduce

Animated GIF of the current behavior:

navigation select new

  • on Windows
  • tab to the Select element
  • use the down arrow key to change value
  • as soon as the value changes, the page re-renders showing the new menu even if the user hasn't explicitly submitted the change
  • this is even more harming because focus is then moved to the menu being edited: there's a specific issue for that, see Navigation page: initial focus shouldn't be set on the navigation menu #25298

Expected behavior
The page to not re-render on the change event. There should be a button to initiate a change of context.

Editor version (please complete the following information):

  • WordPress version: 5.6 trunk
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? plugin
  • If the Gutenberg plugin is installed, which version is it? 9.0.0-rc.1

Activity

  1. added
    [Type] Bug
    [Focus] Accessibility (a11y)
    on Sep 14, 2020
  2. added this to the milestone on Sep 14, 2020
  3. removed this from the milestone on Sep 16, 2020
  4. self-assigned this
    on Sep 17, 2020
  5. added
    [Status] In Progress
    on Sep 17, 2020
  6. shaunandrews commented on Sep 17, 2020

    @shaunandrews
    Contributor

    I'm thinking it might be better to consolidate the interactions; All the other buttons here (Add new, Manage locations) are DropdownMenu's and maybe this one should be too. It would look something like this:

    dropdownmenu

  7. afercia commented on Sep 18, 2020

    @afercia
    ContributorAuthor

    Yep a DropdownMenu is an option and I do see it brings in consistency. However, it doesn't show which is the currently selected menu being edited. This missing info could be communicated separately though.

    Given this page needs also some more headings to better identify the main sections (worth reminding headings are also a navigational tool for screen reader users) I'd like to propose to add a <h2> heading before the menu toolbar and the heading text would be the name of the menu being edited.

    Aside: the tree view on the right has a <h3> heading with text "List view" that should be bumped up to a <h2> as the headings hierarchy is skipping one level.

    I see @talldan made a PR for a select + button in the meantime. Going to have a look but I like the idea of a DropdownMenu [Edit] I did read only the first part of the PR 😆 I see it was changed to use a DropdownMenu 👍

  8. shaunandrews commented on Sep 18, 2020

    @shaunandrews
    Contributor

    Aside: the tree view on the right has a <h3> heading with text "List view" that should be bumped up to a <h2> as the headings hierarchy is skipping one level.

    If we do add a <h2> heading for the current menu indicator, wouldn't it make sense for the list view heading to remain an <h3>?

  9. afercia commented on Sep 21, 2020

    @afercia
    ContributorAuthor

    Hm... not sure. Do you see the "list view" as a sub-section of the menu-edit section? Or are they two sections of the same importance? Generally, fewer heading levels are better because are simpler and faster to navigate through. I'd go for a H3 only for a section that is clearly, logically a sub-section.

    This has nothing to do with the visual side: headings don't necessarily need to look "big", as long as the visual hierarchy is preserved besides the semantic hierarchy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Focus] Accessibility (a11y)[Status] In Progress[Type] Bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions