mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Guard against no other focusable elements
This previously occurred in areas we all the elements had a -1 tabindex or were disabled.
This commit is contained in:
@@ -124,7 +124,10 @@ class WindowEventHandler
|
||||
nextTabIndex = tabIndex
|
||||
nextElement = element
|
||||
|
||||
(nextElement ? lowestElement).focus()
|
||||
if nextElement?
|
||||
nextElement.focus()
|
||||
else if lowestElement?
|
||||
lowestElement.focus()
|
||||
|
||||
focusPrevious: =>
|
||||
focusedTabIndex = parseInt($(':focus').attr('tabindex')) or Infinity
|
||||
@@ -142,4 +145,7 @@ class WindowEventHandler
|
||||
previousTabIndex = tabIndex
|
||||
previousElement = element
|
||||
|
||||
(previousElement ? highestElement).focus()
|
||||
if previousElement?
|
||||
previousElement.focus()
|
||||
else if highestElement?
|
||||
highestElement.focus()
|
||||
|
||||
Reference in New Issue
Block a user