Page MenuHomePhabricator

'Search' placeholder is inserted even if search field already has focus
Closed, ResolvedPublic

Description

If you click in the search field before the 'Search' placeholder text is inserted (which is quite easy now in 1.17), it still inserts the placeholder text in Firefox. At that point it treats 'Search' as the text you are searching for.

This doesn't seem to occur in Safari


Version: 1.17.x
Severity: normal

Details

Reference
bz27944

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:26 PM
bzimport added a project: MediaWiki-Search.
bzimport set Reference to bz27944.

This seems to also occur in some mobile browsers.

Basically any browser that does not support placeholder natively and triggers the fallback.

Also, Explorer 7, changing bug title...

Fixed in r83586 by removing the placeholder as soon as anything (keydown, paste, drop) happens in the text box. This means that, if the search box is focused before the placeholder plugin runs, the placeholder will still be inserted, but it'll be removed once you start typing, so the placeholder text will no longer be added to your search query.