Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Pane shouldn't steal focus from its children - #14403

Merged
as-cii merged 1 commit into
masterfrom
fb-mdt-pane-steals-focus
May 15, 2017
Merged

as-cii merged 1 commit into
masterfrom
fb-mdt-pane-steals-focus

Conversation

@matthewwithanm

Copy link
Copy Markdown
Contributor

This was removed in #14175 in order to solve #14173 (editors not being
focused when clicking tabs). However, it means that the pane steals
focus from its children. The solution is to add the guard back and to
solve #14173 in another way: by delaying the activation of the item
(see atom/tabs#439).

This was removed in #14175 in order to solve #14173 (editors not being
focused when clicking tabs). However, it means that the pane steals
focus from its children. The solution is to add the guard back and to
solve #14173 in another way: by delaying the activation of the item
(see atom/tabs#439).

@nathansobo nathansobo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As soon as we get a green build on atom/tabs#439 this looks good. Thanks again!

matthewwithanm added a commit to atom/tabs that referenced this pull request May 12, 2017
This was originally added way back in 310c058 however, a tabindex of -1
means that the tab bar can receive focus.

As a result, focus would end up being transferred to the tab bar as
part of the default action of the mousedown handler. When the `Pane` is
activated, it would see that its child (the tab bar) had focus and
leave it there, meaning the tab bar (instead of the editor) would
retain focus. This behavior was first reported in #14173, however the
original fix for it (#14175) resulted in Panes always stealing the
focus from their children. This regression was rectified with
atom/atom#14403 and #439, but really the tab bar shouldn't be
focusable in the first place. Making this adjustment means we no longer
have to delay the activation of the item and pane (#150 and
atom/tabs#tabs#439) since the focus will no longer be given to the tab
bar as part of the default action of the mousedown handler.
@as-cii
as-cii merged commit 2e363c3 into master May 15, 2017
@as-cii
as-cii deleted the fb-mdt-pane-steals-focus branch May 15, 2017 14:15
@as-cii

as-cii commented May 15, 2017

Copy link
Copy Markdown
Contributor

Thanks!

as-cii pushed a commit that referenced this pull request May 15, 2017
Pane shouldn't steal focus from its children
matthewwithanm added a commit to atom/tabs that referenced this pull request May 15, 2017
This was originally added way back in 310c058 however, a tabindex of -1
means that the tab bar can receive focus.

As a result, focus would end up being transferred to the tab bar as
part of the default action of the mousedown handler. When the `Pane` is
activated, it would see that its child (the tab bar) had focus and
leave it there, meaning the tab bar (instead of the editor) would
retain focus. This behavior was first reported in #14173, however the
original fix for it (#14175) resulted in Panes always stealing the
focus from their children. This regression was rectified with
atom/atom#14403 and #439, but really the tab bar shouldn't be
focusable in the first place. Making this adjustment means we no longer
have to delay the activation of the item and pane (#150 and
atom/tabs#tabs#439) since the focus will no longer be given to the tab
bar as part of the default action of the mousedown handler.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants