From c5aa446bc2bbaf426bacfdb14effe03e2c0b0220 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 2 Sep 2014 11:37:46 -0600 Subject: [PATCH] Prevent focusout events on hidden input when clicking focused editors Fixes #3384 This is achieved by calling .preventDefault() on mousedown events when the editor is already focused, which prevents the moving of focus to the editor itself. --- src/editor-component.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/editor-component.coffee b/src/editor-component.coffee index b14a169b8..732a0da88 100644 --- a/src/editor-component.coffee +++ b/src/editor-component.coffee @@ -614,6 +614,9 @@ EditorComponent = React.createClass # CTRL+click brings up the context menu on OSX, so don't handle those either return if ctrlKey and process.platform is 'darwin' + # Prevent focusout event on hidden input if editor is already focused + event.preventDefault() if @state.focused + screenPosition = @screenPositionForMouseEvent(event) if event.target?.classList.contains('fold-marker')