RFR: 8366278: Form control element <select> has no associated label
Hannes Wallnöfer
hannesw at openjdk.org
Mon Sep 8 13:27:11 UTC 2025
On Thu, 28 Aug 2025 10:13:24 GMT, Pasam Soujanya <duke at openjdk.org> wrote:
> Associating a meaningful label with every UI control allows the browser and assistive technology to expose and announce the control to a user. Associating a visible label also provides a larger clickable area.
>
> `<select id="search-modules">` should contain a label or title to describe it's purpose.
Thanks for the fix! Comments/suggestions below.
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SearchWriter.java line 111:
> 109: var select = HtmlTree.of(HtmlTag.SELECT)
> 110: .setId(HtmlId.of("search-modules"))
> 111: .put(HtmlAttr.TITLE, "search in modules")
Should there be an `aria-label` attribute in addition to (or instead of) the `title` attribute?
The value of the attribute shoudl be localized, using `contents.getContent("doclet...")` with an appropriate new entry in `standard.properties`.
-------------
Changes requested by hannesw (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/26982#pullrequestreview-3196527661
PR Review Comment: https://git.openjdk.org/jdk/pull/26982#discussion_r2330239473
More information about the javadoc-dev
mailing list