Fixed bug: .focus() on searchable select won't focus visible input field.
This commit is contained in:
parent
18d4074329
commit
7592843a5c
1 changed files with 5 additions and 0 deletions
|
@ -4,6 +4,7 @@ class App.SearchableSelect extends Spine.Controller
|
||||||
'input .js-input': 'onInput'
|
'input .js-input': 'onInput'
|
||||||
'blur .js-input': 'onBlur'
|
'blur .js-input': 'onBlur'
|
||||||
'focus .js-input': 'onFocus'
|
'focus .js-input': 'onFocus'
|
||||||
|
'focus .js-shadow': 'onShadowFocus'
|
||||||
'click .js-option': 'selectItem'
|
'click .js-option': 'selectItem'
|
||||||
'click .js-enter': 'navigateIn'
|
'click .js-enter': 'navigateIn'
|
||||||
'click .js-back': 'navigateOut'
|
'click .js-back': 'navigateOut'
|
||||||
|
@ -351,6 +352,10 @@ class App.SearchableSelect extends Spine.Controller
|
||||||
@input.prop('selectionStart', textEnd)
|
@input.prop('selectionStart', textEnd)
|
||||||
@input.prop('selectionEnd', textEnd)
|
@input.prop('selectionEnd', textEnd)
|
||||||
|
|
||||||
|
# propergate focus to our visible input
|
||||||
|
onShadowFocus: ->
|
||||||
|
@input.focus()
|
||||||
|
|
||||||
onInput: (event) =>
|
onInput: (event) =>
|
||||||
@toggle() if not @isOpen
|
@toggle() if not @isOpen
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue