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

aria-disabled=true input still receives label click to trigger on change #623

Closed
oliverfoster opened this issue Feb 6, 2025 · 0 comments · Fixed by #624
Closed

aria-disabled=true input still receives label click to trigger on change #623

oliverfoster opened this issue Feb 6, 2025 · 0 comments · Fixed by #624
Assignees
Labels

Comments

@oliverfoster
Copy link
Member

oliverfoster commented Feb 6, 2025

If an input element has [aria-disabled=true] it is prevented from receiving click events by:

const isAriaDisabled = $element.closest('[aria-disabled=true]').length === 1;
if (isAriaDisabled) {
event.preventDefault();
event.stopImmediatePropagation();
}

However any associated label[for] is not prevented from receiving click events, those events propagate to the input and allow it to trigger a change event on the input in spite of its [aria-disabled=true] status.

This is a relatively new issue create by switching mcq and gmcq to [aria-disabled=true] from [disabled] in order to better facilitate screen readers at pr adaptlearning/adapt-contrib-mcq#228

@oliverfoster oliverfoster self-assigned this Feb 6, 2025
@oliverfoster oliverfoster moved this from New to Needs Reviewing in adapt_framework: The TODO Board Feb 6, 2025
@github-project-automation github-project-automation bot moved this from Needs Reviewing to Recently Released in adapt_framework: The TODO Board Feb 11, 2025
github-actions bot pushed a commit that referenced this issue Feb 11, 2025
## [6.60.6](v6.60.5...v6.60.6) (2025-02-11)

### Fix

* Prevent label clicks and key presses from changing [aria-disabled] inputs (fixes #623) (#624) ([0fda594](0fda594)), closes [#623](#623) [#624](#624)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Recently Released
1 participant