Skip to content

Commit 504f95e

Browse files
committed
Fix single documentation search on Android
1 parent 3a8be50 commit 504f95e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

assets/javascripts/views/search/search_scope.coffee

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class app.views.SearchScope extends app.View
77

88
@events:
99
keydown: 'onKeydown'
10+
textInput: 'onTextInput'
1011

1112
@routes:
1213
after: 'afterRoute'
@@ -100,6 +101,12 @@ class app.views.SearchScope extends app.View
100101
$.stopEvent(event) if @doc
101102
return
102103

104+
onTextInput: (event) =>
105+
if event.data == ' ' and app.isMobile()
106+
@search @input.value[0...@input.selectionStart]
107+
$.stopEvent(event) if @doc
108+
return
109+
103110
extractHashValue: ->
104111
if value = @getHashValue()
105112
newHash = $.urlDecode(location.hash).replace "##{SEARCH_PARAM}=#{value} ", "##{SEARCH_PARAM}="

0 commit comments

Comments
 (0)