mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Correctly focus fuzzy-finder/event-palette when triggered while other is showing
When canceling the fuzzy finder or event palette, we should only focus the root view / previous element if the mini editor is still focused. Otherwise, it was a change of focus elsewhere that caused us to be cancelled, and we don't want to interfere with that focus change.
This commit is contained in:
@@ -89,7 +89,7 @@ class SelectList extends View
|
||||
|
||||
cancel: ->
|
||||
@cancelling = true
|
||||
@detach()
|
||||
@cancelled()
|
||||
@detach()
|
||||
@cancelling = false
|
||||
|
||||
|
||||
@@ -47,5 +47,5 @@ class EventPalette extends SelectList
|
||||
@previouslyFocusedElement.trigger(eventName)
|
||||
|
||||
cancelled: ->
|
||||
@previouslyFocusedElement.focus()
|
||||
@previouslyFocusedElement.focus() if @miniEditor.isFocused
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class FuzzyFinder extends SelectList
|
||||
|
||||
cancelled: ->
|
||||
@miniEditor.setText('')
|
||||
@rootView.focus()
|
||||
@rootView.focus() if @miniEditor.isFocused
|
||||
|
||||
toggleFileFinder: ->
|
||||
if @hasParent()
|
||||
|
||||
Reference in New Issue
Block a user