This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
Delay pane activation on mousedown to fix loss of focus - #150
Merged
Merged
Conversation
Contributor
|
@nathansobo This seems to break the ability to drag tabs (e.g. to reorder them in the tab bar, or to drag them to another window). Are you seeing the same problem with these changes applied? |
nathansobo
force-pushed
the
ns-fix-focus-on-click
branch
from
June 10, 2015 19:42
5eb2c3c to
b572fa6
Compare
Contributor
Author
|
@izuzak Want to give this a spin? |
Contributor
|
@nathansobo Works great, as far as I can tell! ⚡ |
nathansobo
pushed a commit
that referenced
this pull request
Jun 10, 2015
Delay pane activation on mousedown to fix loss of focus
matthewwithanm
added a commit
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.
matthewwithanm
added a commit
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Force pushed an update to this pull request. This should now fix atom/atom#6662 without breaking dragging.
There's a complex interaction going on between
focus,mousedown, anddragstartevents. It seems that no matter what I try, ifdocument.activeElementchanges synchronously during amousedownevent, the subsequentdragstartevent is never handled. There may be a hidden issue regarding our focus handling in core that would enable a more elegant fix to this, but I haven't been able to find it and would like to just fix the immediate issue for now.