Skip to content
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

Use onClick to make Site Editor Open Admin Sidebar Button keyboard accessible #50067

Closed
wants to merge 2 commits into from

Commits on Apr 25, 2023

  1. Configuration menu
    Copy the full SHA
    d1a2b09 View commit details
    Browse the repository at this point in the history
  2. Make Admin Sidebar button into a toggle to improve a11y.

    On the site editor, when the Admin Sidebar is open, the button label and tooltip says "Open Admin Sidebar," but it is already open, so the button doesn't do anything when clicked again which makes it seem broken.
    
    I switched it into a toggle to open/close the Admin Sidebar as a starting point to at least fix the accessbility of it, as a non-functional button feels broken. I considered a couple other options but they had their own issues:
    
    1. When the sidebar is open, have the button go back to the dashboard. This action would mean switching it from a `<button>` when the dashboard is closed, and then changing it to an `<a>` element afterwards to semantically describe the functionality. Switching the element's action like that feels confusing.
    
    2. Disable focus on the button when the panel is open. When the panel is closed, clicking the Open Admin Sidebar button could open the sidebar and then place focus on the first item of the navigation menu. This could be a fine solution, but would require more work, so I didn't want to go through with that interaction unless others agreed it was desired. Switching to a toggle was the simplest way to address it in a sensible way.
    jeryj committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    6e809d6 View commit details
    Browse the repository at this point in the history