Search field on http://www.openstreetmap.org should autofocus #5065
Comments
Author: TomH I have to say I remain entirely unconvinced by the claim that the first thing most people will do is to search. That might possibly be true for new users but I very much doubt it is for returning users. What I can say is that overall we have five times more visitors to the front page than we do searches, and that includes all searches not just those made immediately after arriving on the front page. The real problem however, given that regardless of how important you think this is there is little real downside, is that the new site design includes placeholder text in the search field which will, to some extent, conflict with autofocusing. What I'm not sure about yet is how much. Certainly in Firefox at least it appears to be safe to use HTML5 autofocus as no focus event will be generated (that would fade out the placeholder) until the user starts to type. Whether that is true in other browsers needs to be determined. In older browsers we used to focus via javascript instead, but that would almost certainly generate a focus event. Then again I guess the placeholder text (which is generated by an HTML5 placeholder attribute) may not show there anyway. |
Author: TomH An update following some browser testing: Firefox 25 - HTML5 autofocus preserves placeholder[[BR]] Opera 12 isn't a major issue as I'm guessing the new webkit based version will do what Chrome does, and likely Safari will as well. Would be good to know what later IEs do. |
Author: TomH Update: IE10 - No placeholder shown, needs JS autofocus[[BR]] |
Author: TomH It seems IE11 does show the placeholder but (a) removes it on focus rather than when you start typing and (b) doesn't support the autofocus attribute. |
Author: TomH Fixed in [changeset:9cc9a00/rails]. |
Author: Vinnl Thanks TomH, looks great. I must admit that I'm a new user, but as such, I'm loving this. |
Reporter: Vinnl
[Submitted to the original trac issue database at 7.26pm, Monday, 9th December 2013]
Currently, when I open http://www.openstreetmap.org there is no way to interact with it directly using the keyboard. Since the most frequent action will likely be to search for a destination, the search field should receive the HTML autofocus attribute[1]. Apparently this was added to the previous website as well: #3797
[1] http://diveintohtml5.org/forms.html#autofocus
The text was updated successfully, but these errors were encountered: