Merge pull request #5747 from mbudm/issue/5434

Make keyboard UI close on iOS when done searching
This commit is contained in:
Luis Ramos
2020-07-24 13:25:39 +01:00
committed by GitHub
2 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
Darkswarm.directive "disableEnterWithBlur", ()->
# Stops enter from doing normal enter things, and blurs the input
restrict: 'A'
link: (scope, element, attrs)->
element.bind "keydown keypress", (e)->
code = e.keyCode || e.which
if code == 13
element.blur()
e.preventDefault()

View File

@@ -6,7 +6,7 @@
type: 'search',
placeholder: t(:products_search),
"ng-debounce" => "200",
"ofn-disable-enter" => true}
"disable-enter-with-blur" => true}
%a.clear{type: 'button', ng: {show: 'query', click: 'clearQuery()'}, 'focus-search' => true}
= image_tag "icn-close.png"