File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 36
36
var input = controller . input
37
37
var autocomplete = input . autocomplete
38
38
var typeahead = input . data ( 'aaAutocomplete' )
39
- autocomplete . setVal ( )
39
+ autocomplete . setVal ( ) // clear value on page reload
40
+ input . on ( 'autocomplete:closed' , clearSearch . bind ( autocomplete ) )
40
41
input . on ( 'autocomplete:selected' , disableClose )
41
42
input . on ( 'autocomplete:updated' , resetScroll . bind ( autocomplete . getWrapper ( ) . firstChild ) )
42
43
typeahead . dropdown . _ensureVisible = ensureVisible
43
44
if ( filterInput ) filterInput . addEventListener ( 'change' , toggleFilter . bind ( typeahead ) )
44
45
monitorCtrlKey ( input , typeahead . dropdown )
45
46
searchField . addEventListener ( 'click' , confineEvent )
46
- document . documentElement . addEventListener ( 'click' , resetSearch . bind ( autocomplete ) )
47
+ document . documentElement . addEventListener ( 'click' , clearSearch . bind ( autocomplete ) )
47
48
document . addEventListener ( 'keydown' , handleShortcuts . bind ( input ) )
48
49
if ( input . attr ( 'autofocus' ) != null ) input . focus ( )
49
50
}
114
115
if ( e . keyCode === CTRL_KEY ) this . focus ( )
115
116
}
116
117
117
- function resetSearch ( ) {
118
+ function clearSearch ( ) {
118
119
this . close ( )
119
120
this . setVal ( )
120
121
}
You can’t perform that action at this time.
0 commit comments