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

Checkbox examples should not repeatedly toggle while holding down spacebar #2425

Closed
sivakusayan opened this issue Jul 26, 2022 · 4 comments · Fixed by #2518
Closed

Checkbox examples should not repeatedly toggle while holding down spacebar #2425

sivakusayan opened this issue Jul 26, 2022 · 4 comments · Fixed by #2518
Labels
bug Code defects; not for inaccurate prose Example Page Related to a page containing an example implementation of a pattern

Comments

@sivakusayan
Copy link
Contributor

sivakusayan commented Jul 26, 2022

I notice that in Checkbox Example (Two State), focusing a checkbox and holding down the spacebar key repeatedly toggles the checkbox. This does not happen with native HTML checkboxes. I wonder if this could be an issue for people with motor disabilities.

If my intuition is correct and this is an issue, the fix should be simple - we just need to add an event.repeat check in the onKeyDown listener.
If we really care about parity with native HTML checkboxes, this logic should probably be done in a keyup listener, though.

@mcking65 mcking65 added bug Code defects; not for inaccurate prose Example Page Related to a page containing an example implementation of a pattern labels Nov 1, 2022
@css-meeting-bot
Copy link
Member

The ARIA Authoring Practices (APG) Task Force just discussed Checkbox key repeat fix.

The full IRC log of that discussion <Matt_King> TOPIC: Checkbox key repeat fix
<Matt_King> github: https://github.com//issues/2425
<jongund> MK: Is there any discussion about the premise of the issue
<jongund> MK: Is this a bug
<jongund> JG: The code fix seems to make sense
<jongund> JN: Native checkboxes toggle on the keyup
<jongund> JN: Change spacebar to space
<jongund> MK: I requested review from sara and ..
<jongund> MK: JG can you review
<jongund> JG: Yes
<jongund> MK: we need functional review and JS review
<jongund> MK: Does this effect the regression test
<jongund> MK: Are there regression test issues?
<jongund> AF: I will look in to it

mcking65 pushed a commit that referenced this issue Nov 10, 2022
…2518)

Fix issue #2425 by changing checkbox key event processing to wait until key up to activate the checkbox.
This prevents the checkbox from toggling continuously if someone holds down the Space key too long.
@mcking65 mcking65 added this to the Q3/2022 APG Content Updates milestone Nov 10, 2022
@mcking65
Copy link
Contributor

Thank you @sivakusayan for the fix!

@mcking65 mcking65 changed the title Checkbox example should not repeatedly toggle while holding down spacebar Checkbox examples should not repeatedly toggle while holding down spacebar Jun 10, 2023
@mcking65
Copy link
Contributor

Re-opening because this applies to both two-state and mixed state checkbox examples. Will be closed by #2722.

@mcking65 mcking65 reopened this Jun 10, 2023
mcking65 pushed a commit that referenced this issue Jun 26, 2023
… toggling (pull #2722)

Modified JavaScript for Checkbox Example (Mixed-State) so that the state of the checkbox does not change until key up. This change prevents continuous toggling if the user holds down the space key.

This is the same change that was made for Checkbox Example (Two State) in pull request #2518.

This commit fully resolves issue #2425.
@mcking65
Copy link
Contributor

Resolved for remaining checkbox example with #2722.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Code defects; not for inaccurate prose Example Page Related to a page containing an example implementation of a pattern
Development

Successfully merging a pull request may close this issue.

3 participants