mirror of
https://github.com/atom/atom.git
synced 2026-02-19 02:44:29 -05:00
Fix corner cases related to lifecycle state of EditorComponent on events
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
@@ -38,6 +38,9 @@ ScrollbarComponent = React.createClass
|
||||
|
||||
@getDOMNode().addEventListener 'scroll', @onScroll
|
||||
|
||||
componentWillUnmount: ->
|
||||
@getDOMNode().removeEventListener 'scroll', @onScroll
|
||||
|
||||
shouldComponentUpdate: (newProps) ->
|
||||
return true if newProps.visible isnt @props.visible
|
||||
|
||||
|
||||
@@ -435,7 +435,8 @@ TextEditorComponent = React.createClass
|
||||
@refs.input.focus()
|
||||
|
||||
blurred: ->
|
||||
@setState(focused: false)
|
||||
if @isMounted()
|
||||
@setState(focused: false)
|
||||
|
||||
onTextInput: (event) ->
|
||||
event.stopPropagation()
|
||||
|
||||
@@ -111,7 +111,7 @@ class TextEditorElement extends HTMLElement
|
||||
|
||||
blurred: (event) ->
|
||||
unless atom.config.get('editor.useShadowDOM')
|
||||
if event.relatedTarget is @component?.refs.input.getDOMNode()
|
||||
if event.relatedTarget is @component?.refs.input?.getDOMNode()
|
||||
event.stopImmediatePropagation()
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user