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

Change focus management in disclosure utility component #284

Merged
merged 7 commits into from
May 18, 2022

Commits on May 18, 2022

  1. Use FocusEvent API to deactivate content

    To avoid focus trapping and preserve the requirement that a click (or tap or tab) outside of the disclosure will close/deactivate the content
    alex-ju committed May 18, 2022
    Configuration menu
    Copy the full SHA
    bb80285 View commit details
    Browse the repository at this point in the history
  2. Allow deactivation using Escape key

    Preserve the requirements that Escape key should close/deactivate the content and when used, focus should return to button/toggle.
    alex-ju committed May 18, 2022
    Configuration menu
    Copy the full SHA
    cf95c67 View commit details
    Browse the repository at this point in the history
  3. Remove ember-focus-trap

    alex-ju committed May 18, 2022
    Configuration menu
    Copy the full SHA
    5bddea7 View commit details
    Browse the repository at this point in the history
  4. Allow interactive events on our disclosure template

    Our linter doesn't allow interactive events on standard elements complaining about 'keyup' being used on the main component element. As our disclosure component is interactive (jn a sense that expands and collapses a container) we need to add this exception to the template.
    alex-ju committed May 18, 2022
    Configuration menu
    Copy the full SHA
    3db16fc View commit details
    Browse the repository at this point in the history
  5. Replace skipped disclosure tests

    We explicitly test the functionality we introduced with this component, which is handling the escape key and the focus out. As a note, these two tests could be grouped under a 'when disclosure content is visible', but I would avoid introducing nested tests as we don't seem to have them anywhere else and we don't have many tests for this component anyway.
    alex-ju committed May 18, 2022
    Configuration menu
    Copy the full SHA
    c36036c View commit details
    Browse the repository at this point in the history
  6. Patch button focus when clicked on WebKit

    Webkit doesn't give a `focus` state to buttons when clicked (a behaviour that is different from all the other vendors; see https://bugs.webkit.org/show_bug.cgi?id=22261). To overcome this difference in behaviour we apply a focus state to the buttons used to toggle the disclosed content.
    
    Fixup! Patch button focus when clicked WebKit
    alex-ju committed May 18, 2022
    Configuration menu
    Copy the full SHA
    40cd7f6 View commit details
    Browse the repository at this point in the history
  7. Add changelog entry

    alex-ju committed May 18, 2022
    Configuration menu
    Copy the full SHA
    ba40988 View commit details
    Browse the repository at this point in the history