mirror of
https://github.com/atom/atom.git
synced 2026-02-10 14:45:11 -05:00
Gracefully handle focus prior to detecting the editor has become visible
This commit is contained in:
committed by
Antonio Scandurra
parent
82feef9f68
commit
401434858b
@@ -676,6 +676,12 @@ class TextEditorComponent {
|
||||
// against that case.
|
||||
if (!this.attached) this.didAttach()
|
||||
|
||||
// The element can be focused before the intersection observer detects that
|
||||
// it has been shown for the first time. If this element is being focused,
|
||||
// it is necessarily visible, so we call `didShow` to ensure the hidden
|
||||
// input is rendered before we try to shift focus to it.
|
||||
if (!this.visible) this.didShow()
|
||||
|
||||
if (!this.focused) {
|
||||
this.focused = true
|
||||
this.scheduleUpdate()
|
||||
|
||||
Reference in New Issue
Block a user