mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-04 21:28:48 +03:00
Trigger editor:will-be-removed from SpacePen shim, not component
By the time the component is getting unmounted, we have already called remove hooks on the SpacePen shim so subscriptions to the event have been removed.
This commit is contained in:
parent
616a94a10e
commit
b5edefcae8
@ -199,7 +199,6 @@ TextEditorComponent = React.createClass
|
||||
componentWillUnmount: ->
|
||||
{editor, hostElement} = @props
|
||||
|
||||
hostElement.__spacePenView.trigger 'editor:will-be-removed', [hostElement.__spacePenView]
|
||||
@unsubscribe()
|
||||
@scopedConfigSubscriptions.dispose()
|
||||
window.removeEventListener 'resize', @requestHeightAndWidthMeasurement
|
||||
|
@ -138,6 +138,7 @@ class TextEditorView extends View
|
||||
|
||||
beforeRemove: ->
|
||||
@trigger 'editor:detached', [this]
|
||||
@trigger 'editor:will-be-removed', [this]
|
||||
@attached = false
|
||||
|
||||
remove: (selector, keepData) ->
|
||||
|
Loading…
Reference in New Issue
Block a user