mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Focus search field after it's cleared, ready for immediate typing of new search term on mobile
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
Darkswarm.directive "focusSearch", ->
|
||||
restrict: 'A'
|
||||
link: (scope, element, attr)->
|
||||
element.bind 'click', (event) ->
|
||||
# Focus seach field, ready for typing
|
||||
$(element).siblings('#search').focus()
|
||||
@@ -6,7 +6,7 @@
|
||||
placeholder: t(:products_search),
|
||||
"ng-debounce" => "200",
|
||||
"ofn-disable-enter" => true}
|
||||
%a.clear{type: 'button', ng: {show: 'query', click: 'clearQuery()'}}
|
||||
%a.clear{type: 'button', ng: {show: 'query', click: 'clearQuery()'}, 'focus-search' => true}
|
||||
%img{ src: "/assets/icn-close.png" }
|
||||
|
||||
.hide-for-large-up
|
||||
|
||||
Reference in New Issue
Block a user