X Tutup
Skip to content

fix: Add ARIA attributes and roles to print disability dynamic section #11560

Merged
jimchamp merged 4 commits intointernetarchive:masterfrom
mystic-06:fix/10801-registration-form-accessibility
Feb 20, 2026
Merged

fix: Add ARIA attributes and roles to print disability dynamic section #11560
jimchamp merged 4 commits intointernetarchive:masterfrom
mystic-06:fix/10801-registration-form-accessibility

Conversation

@mystic-06
Copy link
Contributor

Closes #10801

Fix

Technical

  • Added aria-expanded and aria-controls to the print disability checkbox
  • Added role="region", aria-hidden, and aria-labelledby to the dropdown container
  • Added aria-describedby, aria-required, and aria-invalid to the program selector
  • Added role="alert" + aria-live="polite" for error messaging
  • Updated JS to toggle ARIA states dynamically (expanded/hidden/required/invalid) based on checkbox state
  • Added safety null checks to avoid JS errors when elements are not present

Testing

  • Tested with Orca on Linux (CachyOS/GNOME)
  • Verified ARIA state changes through browser DevTools
  • Confirmed error messages are announced correctly
  • Checked keyboard navigation (Tab/Space/Enter/Arrow keys)
  • All existing unit tests pass

@github-actions github-actions bot added the Priority: 2 Important, as time permits. [managed] label Dec 6, 2025
@mystic-06 mystic-06 force-pushed the fix/10801-registration-form-accessibility branch from 9ab795a to 0140821 Compare December 9, 2025 09:18
@mystic-06
Copy link
Contributor Author

mystic-06 commented Dec 9, 2025

Hi @jimchamp ! I know maintainers are busy, but I wanted to check in on this PR.
If there’s any feedback or anything I might have missed, I'd be glad to address it.
Thank you!

@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label Dec 10, 2025
Copy link
Collaborator

@jimchamp jimchamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mystic-06, and apologies for the delay.

This mostly looks good. Please update the code to use kebab case for any new HTML classes or IDs. The guards that you have added should also be removed.

Comment on lines +162 to +164
if (!rpdCheckbox || !pdaSelector) {
return;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!rpdCheckbox || !pdaSelector) {
return;
}

Why did you add this? The checkbox and selector are always present in the registration form.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally added the guards because they were needed to keep the existing test cases passing, but I’ll remove them as suggested.

Comment on lines +216 to +218
if (!rpdCheckbox || !pdaSelectorContainer) {
return;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!rpdCheckbox || !pdaSelectorContainer) {
return;
}

<input type="checkbox" id="pd_request" name="pd_request"/>
<label for="pd_request">$:_('I want to apply* for <a href="https://help.archive.org/help/program-overview/" target="_blank">special print disability access</a> through a qualifying program.')</label>
<input type="checkbox" id="pd_request" name="pd_request" aria-expanded="false" aria-controls="pda-selector"/>
<label for="pd_request" id="pd_request_label">$:_('I want to apply* for <a href="https://help.archive.org/help/program-overview/" target="_blank">special print disability access</a> through a qualifying program.')</label>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<label for="pd_request" id="pd_request_label">$:_('I want to apply* for <a href="https://help.archive.org/help/program-overview/" target="_blank">special print disability access</a> through a qualifying program.')</label>
<label for="pd_request" id="pd-request-label">$:_('I want to apply* for <a href="https://help.archive.org/help/program-overview/" target="_blank">special print disability access</a> through a qualifying program.')</label>

HTML class names and IDs should be written using kebab-case.

<div id="pda-selector" class="ol-signup-form__select hidden">
<div class="ol-signup-form__error" id="pd_programMessage"></div>
<select id="pd_program" name="pd_program" aria-label="$_('Select qualifying program')">
<div id="pda-selector" class="ol-signup-form__select hidden" role="region" aria-labelledby="pd_request_label" aria-hidden="true">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div id="pda-selector" class="ol-signup-form__select hidden" role="region" aria-labelledby="pd_request_label" aria-hidden="true">
<div id="pda-selector" class="ol-signup-form__select hidden" role="region" aria-labelledby="pd-request-label" aria-hidden="true">

Comment on lines +223 to +225
if (pdaSelector) {
pdaSelector.setAttribute('aria-required', 'true')
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (pdaSelector) {
pdaSelector.setAttribute('aria-required', 'true')
}
pdaSelector.setAttribute('aria-required', 'true')

Comment on lines +230 to +232
if (pdaSelector) {
pdaSelector.setAttribute('aria-required', 'false')
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (pdaSelector) {
pdaSelector.setAttribute('aria-required', 'false')
}
pdaSelector.setAttribute('aria-required', 'false')

@jimchamp jimchamp added Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] and removed Needs: Response Issues which require feedback from lead labels Dec 22, 2025
@mystic-06
Copy link
Contributor Author

Thanks for the review and for the feedback!
I’ll update the newly added HTML classes and IDs to use kebab-case and remove the guard checks as suggested. I’ll push an updated commit shortly.

@github-actions github-actions bot removed the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Dec 24, 2025
@mystic-06 mystic-06 force-pushed the fix/10801-registration-form-accessibility branch from d1ab706 to 380be2f Compare December 24, 2025 15:08
Copy link

@accesslint accesslint bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are accessibility issues in these changes.

@mystic-06 mystic-06 force-pushed the fix/10801-registration-form-accessibility branch from 380be2f to 495fc6b Compare December 24, 2025 15:16
@mystic-06 mystic-06 requested a review from jimchamp December 24, 2025 16:33
@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label Dec 25, 2025
Copy link
Collaborator

@jimchamp jimchamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once again, sorry for the massive delay. The signup.test.js file needs some updates in order for the tests to pass. Using git apply with the following diff will fix the test cases:

diff --git a/tests/unit/js/signup.test.js b/tests/unit/js/signup.test.js
index 5314c2dac..de61b41b0 100644
--- a/tests/unit/js/signup.test.js
+++ b/tests/unit/js/signup.test.js
@@ -13,10 +13,14 @@ beforeEach(() => {
       <label for="password">Password</label>
       <input type="password" id="password">
       <div id="rpd-checkbox" class="ol-signup-form__checkbox">
-        <input id="pd_request" type="checkbox">
-        <label for="pd_request">PD Checkbox</label>
+        <input id="pd-request" type="checkbox">
+        <label for="pd-request">PD Checkbox</label>
+      </div>
+      <div id="pda-selector" class="ol-signup-form__select hidden">
+        <select id="pd_program" name="pd_program" aria-label="$_('Select qualifying program')" aria-describedby="pd-program-advisory" aria-invalid="false" aria-required="false">
+            <option value="" disabled selected>"Select qualifying program"</option>
+        </select>
       </div>
-      <div id="pda-selector" class="ol-signup-form__select hidden"></div>
     </form>
   `;
 });
@@ -223,7 +227,7 @@ describe('Print disability tests', () => {
     beforeEach(() => {
         initSignupForm();

-        checkbox = document.querySelector('#pd_request');
+        checkbox = document.querySelector('#pd-request');
         selector = document.querySelector('#pda-selector')
     })

Once that's done, the tests will pass and I'll be happy to merge this. Thanks for your patience and good work!

@jimchamp jimchamp added Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] and removed Needs: Response Issues which require feedback from lead labels Jan 10, 2026
@github-actions github-actions bot removed the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Jan 11, 2026
@mystic-06 mystic-06 force-pushed the fix/10801-registration-form-accessibility branch from 73395f3 to 079d73d Compare January 11, 2026 19:29
@mystic-06
Copy link
Contributor Author

Thanks for the feedback! I’ve fixed the related tests. Please let me know if anything else needs tweaking.

@jimchamp

@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label Jan 12, 2026
@mystic-06 mystic-06 force-pushed the fix/10801-registration-form-accessibility branch from 079d73d to 1e4b83d Compare January 17, 2026 18:13
@mystic-06
Copy link
Contributor Author

Hi @jimchamp ! Just checking on the status of this PR — please let me know if anything is needed from my side. Thanks!

Copy link
Collaborator

@jimchamp jimchamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mystic-06!

@jimchamp jimchamp merged commit 82c3fe0 into internetarchive:master Feb 20, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Response Issues which require feedback from lead Priority: 2 Important, as time permits. [managed]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ARIA roles and attributes to account registration page

2 participants

X Tutup