OK,

It's a shame that the placeholder attribute does not work as well as might be expected.

https://www.w3schools.com/tags/att_input_placeholder.asp

-- Jon


On 03/26/2019 05:04 AM, Hannes Wallnöfer wrote:
Sorry, please ignore the RFR and webrev I just sent out.

I tested the generated docs on Windows with both Edge and IE 11, and the 
placeholder attribute is not well supported on either browser. It kind of 
works, but there are various issues that come with it, such as the placeholder 
not showing up when it should, or initial focus not working as expected.

I therefore propose to withdraw my previous webrev and just fix the existing 
solution, which as I wrote previously is quite trivial. New webrev is here:

http://cr.openjdk.java.net/~hannesw/8221366/webrev.01/

Thanks,
Hannes


Am 26.03.2019 um 12:11 schrieb Hannes Wallnöfer <[email protected]>:

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

Reply via email to