RFR: 8221366: Search box tries to search for "Search"
Hannes Wallnöfer
hannes.wallnoefer at oracle.com
Tue Mar 26 11:11:50 UTC 2019
Please review:
Bug: https://bugs.openjdk.java.net/browse/JDK-8221366
Webrev: http://cr.openjdk.java.net/~hannesw/8221366/webrev.00/
As I noted on the Jira page, it would probably have been a one-liner to fix the issue with our current self-implemented solution, but since the placeholder functionality is part of HTML 5 and implemented in browsers for a long time [1] I thought it was better to switch to the standard way of doing it.
[1] https://caniuse.com/#feat=input-placeholder
A few notes:
- Implementation in browsers I’ve tested (Firefox, Chrome, Safari) behaves slightly different from our own implementation. With our code, the placeholder disappears when the user clicks in the input box. In the browsers I tested, the placeholder only disappears when actual text is entered by the user.
- The default colour of the placeholder text on most browsers is a slightly lighter grey than the one we were using. Although it is possible to change the appearance via CSS [2] this requires browser-specific CSS selectors. Also, since the placeholder text is still visible when the user starts typing, our darker grey seemed confusing as it was very close to the colour of actual user input. After some experimentation, I think that going with the browser default is a good solution. If we do want to exactly specify the colour we should probably go with something lighter than what we previously had.
[2] https://stackoverflow.com/a/2610741/466618
Hannes
More information about the javadoc-dev
mailing list