From: Ben Shum Date: Mon, 13 Oct 2014 05:57:16 +0000 (-0400) Subject: Move autofocus cursor in basic search to end of value X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fbshum%2Fbasic-search-autofocus;p=working%2FEvergreen.git Move autofocus cursor in basic search to end of value After inserting the search terms for a basic search and initiating the search, the page focuses the cursor on the search box but usually puts the cursor at the beginning of the value (to the left of text) instead of at the end of the search terms (to the right of text). This forces users to delete from the left instead of using the backspace to delete from the right. Setting an onfocus puts the cursor where one might expect it. Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/templates/opac/parts/searchbar.tt2 b/Open-ILS/src/templates/opac/parts/searchbar.tt2 index 5eb3873f6d..b1087587d0 100644 --- a/Open-ILS/src/templates/opac/parts/searchbar.tt2 +++ b/Open-ILS/src/templates/opac/parts/searchbar.tt2 @@ -25,7 +25,7 @@ store_args='{"org_unit_getter": function() { return [% ctx.search_ou %]; }}' [%- END # opac_visible -%] [%- ELSE -%] - [% IF basic_search != "f" %] autofocus [% END %] x-webkit-speech + [% IF basic_search != "f" %] autofocus onfocus="var temp_value=this.value;this.value='';this.value=temp_value" [% END %] x-webkit-speech [%- END # autosuggest enabled %] />