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

Refactor character count to inject new element #2577

Merged
merged 12 commits into from Apr 12, 2022

Commits on Apr 8, 2022

  1. Refactor character count to inject new element

    Changes the character count to inject a new element that is
    live updated, instead of overwriting the content of the initial
    HTML hint.
    
    This is intended to resolve an issue where screen readers are
    reading out all elements referenced in aria-describedby for
    each keystroke, and not just the updated counter element.
    
    #2539
    querkmachine committed Apr 8, 2022
    Copy the full SHA
    7c2ce9d View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    0ced84a View commit details
    Browse the repository at this point in the history
  3. Debounce character counter update

    Debounces the character counter update until 250 milliseconds after the user has stopped typing. This helps prevent multiple rapid-fire updates being queued up by screen readers and read out afterwards, and prevents "stuttering" by screen readers which attempt to read out the updated
    counter and the user's input simultaneously.
    
    The handleFocus method's bugfix for Dragon Naturally Speaking now runs a check to see when the last user input was provided, and will not update the counter if the user has recently typed anything. This prevents the DNS fix from causing the same queuing and stuttering behaviour.
    
    This also fixes a newly identified bug where the keyup, focus and blur event listeners were all being bound twice due to the sync method being called both on script initialisation and on pageshow/DOMContentLoaded events. The sync method has been removed and this now calls
    updateCountMessage directly, which is the part that actually requires syncronisation.
    querkmachine committed Apr 8, 2022
    Copy the full SHA
    8d06cee View commit details
    Browse the repository at this point in the history
  4. Add wait time to tests

    Adds wait time to tests that involve changing the value of the character counter's textarea, so that the 250ms debounce timer can complete the update before the result is tested for.
    querkmachine committed Apr 8, 2022
    Copy the full SHA
    c8f3fe2 View commit details
    Browse the repository at this point in the history
  5. Modify character counter to have screen reader-specific counter

    Splits the character counter into two:
    - A visible counter, that updates immediately, and is hidden to screen readers.
    - An screen reader counter, that updates only after the user has stopped typing for one second, and is visually hidden.
    querkmachine committed Apr 8, 2022
    Copy the full SHA
    9a90f01 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    77bf218 View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    3785624 View commit details
    Browse the repository at this point in the history
  8. Remove dedicated debounced update on keyup

    Some issues were being caused by there being two updates that happened after the user had stopped typing: One being the check that exists for voice dictation users
    (which is debounced so that it doesn't run the check if a user is typing), the other being the debounched update from the keyboard event handling.
    
    These updates could happen very close to one another, causing some screen readers to repeat the updated message or to stop announcing the updates altogether.
    querkmachine committed Apr 8, 2022
    Copy the full SHA
    dd564e3 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2022

  1. Copy the full SHA
    174c4d0 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    22be7cb View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    fe725e6 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2022

  1. Update changelog

    querkmachine committed Apr 12, 2022
    Copy the full SHA
    a876f41 View commit details
    Browse the repository at this point in the history