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:
Nathan Sobo
2014-06-07 12:37:40 +09:00
parent 381ebe1a38
commit fe3ea229a2
2 changed files with 1 additions and 2 deletions

View File

@@ -462,8 +462,6 @@ EditorComponent = React.createClass
when 3 then editor.selectLine()
@selectToMousePositionUntilMouseUp(event)
event.preventDefault()
event.stopPropagation()
onStylesheetsChanged: (stylesheet) ->
@refreshScrollbars() if @containsScrollbarSelector(stylesheet)

View File

@@ -18,6 +18,7 @@
.cursor {
z-index: 2;
pointer-events: none;
}
.editor-contents.is-focused .cursor {