fix(forms): improve accessibility of custom form control JS example#43718
Open
fix(forms): improve accessibility of custom form control JS example#43718
Conversation
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
.../learn_web_development/extensions/forms/how_to_build_custom_form_controls/example_4/index.md
Outdated
Show resolved
Hide resolved
.../learn_web_development/extensions/forms/how_to_build_custom_form_controls/example_4/index.md
Outdated
Show resolved
Hide resolved
.../learn_web_development/extensions/forms/how_to_build_custom_form_controls/example_4/index.md
Outdated
Show resolved
Hide resolved
.../learn_web_development/extensions/forms/how_to_build_custom_form_controls/example_4/index.md
Outdated
Show resolved
Hide resolved
.../learn_web_development/extensions/forms/how_to_build_custom_form_controls/example_4/index.md
Outdated
Show resolved
Hide resolved
Contributor
|
Preview URLs (1 page) (comment last updated: 2026-04-09 08:15:43) |
…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>
chrisdavidmills
requested changes
Apr 9, 2026
Contributor
chrisdavidmills
left a comment
There was a problem hiding this comment.
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:
- 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.
- 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.
Author
|
Thanks, I understand. I’ll move the accessibility-related changes to Example 5 and update the main guide to explain them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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