racket / scribble

Other
201 stars 92 forks source link

Refactor search placeholder #278

Closed sorawee closed 3 years ago

sorawee commented 4 years ago

HTML supports the placeholder attribute, so we should use it instead of implementing it ourselves.

The placeholder attribute is not available prior IE10 (not including IE10). However:

  1. In non-supporting browsers (e.g., IE9), the search functionality should still work correctly.
  2. Non-supporting browsers don't qualify for the "full support" level detailed in https://github.com/racket/scribble/pull/240/ IE9 for instance is released in 2011, and Microsoft announced its end of support in 2016.

Also, technically this is a bug fix. Currently, if users type ...search manuals... as a search query, focus somewhere else, and then focus the search box again, the text will disappear.