From 504f95e4f4d0aaf16c2d4c49c50c477910cd3c6b Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Sun, 25 Nov 2018 00:28:36 +0100 Subject: [PATCH] Fix single documentation search on Android --- assets/javascripts/views/search/search_scope.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/assets/javascripts/views/search/search_scope.coffee b/assets/javascripts/views/search/search_scope.coffee index 24de57ce..9be90dd2 100644 --- a/assets/javascripts/views/search/search_scope.coffee +++ b/assets/javascripts/views/search/search_scope.coffee @@ -7,6 +7,7 @@ class app.views.SearchScope extends app.View @events: keydown: 'onKeydown' + textInput: 'onTextInput' @routes: after: 'afterRoute' @@ -100,6 +101,12 @@ class app.views.SearchScope extends app.View $.stopEvent(event) if @doc return + onTextInput: (event) => + if event.data == ' ' and app.isMobile() + @search @input.value[0...@input.selectionStart] + $.stopEvent(event) if @doc + return + extractHashValue: -> if value = @getHashValue() newHash = $.urlDecode(location.hash).replace "##{SEARCH_PARAM}=#{value} ", "##{SEARCH_PARAM}="