mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Prevent focus loss on double click without breaking single click focus
Previously, we stopped propagation on mousedown events to prevent certain cases where focus was being lost after double clicking to select a word. Unfortunately, this also broke the ability to focus the editor by clicking it. When investigating this, I noticed that whenever we lost focus, the target of the mousedown event was always the cursor. So I tried setting `pointer-events: none` on cursors and can no longer reproduce the double-click issue. /cc @probablycorey
This commit is contained in:
@@ -462,8 +462,6 @@ EditorComponent = React.createClass
|
||||
when 3 then editor.selectLine()
|
||||
|
||||
@selectToMousePositionUntilMouseUp(event)
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
|
||||
onStylesheetsChanged: (stylesheet) ->
|
||||
@refreshScrollbars() if @containsScrollbarSelector(stylesheet)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
.cursor {
|
||||
z-index: 2;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.editor-contents.is-focused .cursor {
|
||||
|
||||
Reference in New Issue
Block a user