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.
This commit is contained in:
Nathan Sobo
2014-09-02 11:37:46 -06:00
parent fbcef99aac
commit c5aa446bc2

View File

@@ -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')