Searchable Select: prevent modal closes when closing a autocompletion dropdown

This commit is contained in:
Felix Niklas 2018-07-29 16:37:17 +02:00
parent 9a09532718
commit fbf6133dfd

View file

@ -140,11 +140,13 @@ class App.SearchableSelect extends Spine.Controller
when 39 then @autocompleteOrNavigateIn event # right
when 37 then @autocompleteOrNavigateOut event # left
when 13 then @onEnter event
when 27 then @onEscape()
when 27 then @onEscape event
when 9 then @onTab event
onEscape: ->
@toggle() if @isOpen
if @isOpen
event.stopPropagation() # if the input is in a modal, prevent the modal from closing
@toggle()
getCurrentOptions: ->
@currentMenu.find('.js-option, .js-enter, .js-back')