RFR: JDK-8274625: Search field placeholder behavior
Hannes Wallnöfer
hannesw at openjdk.java.net
Tue Oct 5 16:17:18 UTC 2021
Please review a change to use the HTML `placeholder` attribute in the javadoc search input instead of an actual input value. This revives the fix I originally created for JDK-8221366 but forwent back then because of insufficient support by the Microsoft IE and Edge browsers. MS Edge has since been updated and supports the placeholder attribute well now.
Example pages generated with this change can be viewed here (top level pages only):
http://cr.openjdk.java.net/~hannesw/8274625/api.00/
I changed the color of the placeholder to a lighter grey than we used for our own solution because the placeholder attribute works in a slightly different way. While we removed the placeholder text when the user clicked on the input field, the standard placeholder is still visible right until the user starts entering text. Because of this, using a darker color for the placeholder is confusing because it can easily be mistaken for actual input. The lighter grey is also closer to the default value for most browsers and web frameworks such as bootstrap.
I also changed the HTML for the search input to not have an initial value of "search" which had then to be cleared by the search script. Furthermore, the `disabled` attributes now come in HTML5 value-less boolean format, i.e. `disabled` instead of `disabled="disabled"`.
In addition to most significant desktop browsers I tested the generated docs on various mobile browsers on Android and iOS devices.
-------------
Commit messages:
- JDK-8274625: Do not set initial value attribute on search input
- JDK-8274625: Search field placeholder behavior
Changes: https://git.openjdk.java.net/jdk/pull/5825/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5825&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8274625
Stats: 43 lines in 9 files changed: 8 ins; 22 del; 13 mod
Patch: https://git.openjdk.java.net/jdk/pull/5825.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/5825/head:pull/5825
PR: https://git.openjdk.java.net/jdk/pull/5825
More information about the javadoc-dev
mailing list