Skip to content

fix(forms): improve accessibility of custom form control JS example#43718

Open
xopsio wants to merge 6 commits intomdn:mainfrom
xopsio:fix-custom-form-controls-a11y
Open

fix(forms): improve accessibility of custom form control JS example#43718
xopsio wants to merge 6 commits intomdn:mainfrom
xopsio:fix-custom-form-controls-a11y

Conversation

@xopsio
Copy link
Copy Markdown

@xopsio xopsio commented Apr 9, 2026

Improves the accessibility of the custom form control example in Example 4.

This updates the HTML and JavaScript so the custom control has clearer combobox/listbox semantics, better keyboard handling, and avoids click propagation and blur issues when selecting options.

Fixes #31250

Improves the accessibility of the custom form control example in Example 4.

This updates the HTML and JavaScript so the custom control has clearer combobox/listbox semantics, better keyboard handling, and avoids click propagation and blur issues when selecting options.

Fixes mdn#31250
@xopsio xopsio requested a review from a team as a code owner April 9, 2026 03:50
@github-actions github-actions bot added Content:Learn Learning area docs size/m [PR only] 51-500 LoC changed labels Apr 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Preview URLs (1 page)

(comment last updated: 2026-04-09 08:15:43)

chrisdavidmills and others added 5 commits April 9, 2026 09:12
…d_custom_form_controls/example_4/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…d_custom_form_controls/example_4/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…d_custom_form_controls/example_4/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…d_custom_form_controls/example_4/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…d_custom_form_controls/example_4/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

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

Hi there, @xopsio, and thank you for your work on improving the accessibility of this example.

The code updates seem reasonable to me. There are a couple of issues with your approach, however:

  1. The guide that this example is part of would also need to be updated to explain the code changes you have made: https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/How_to_build_custom_form_controls.
  2. The guide is in multiple parts. You've updated Example 4 to add the accessibility improvements; however, it is Example 5 that deals with making the custom widget accessible: https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/How_to_build_custom_form_controls/Example_5.

I would suggest that you add your changes to Example 5 instead, and update the information on accessibility in the guide to talk about your new changes.

@xopsio
Copy link
Copy Markdown
Author

xopsio commented Apr 10, 2026

Thanks, I understand. I’ll move the accessibility-related changes to Example 5 and update the main guide to explain them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Learn Learning area docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to build custom form controls: JS example is not accessible

3 participants