Don't allow updates to be requested for unmounted components

In 444c18be34, I stopped polling the DOM
when an update was pending to prevent delay of the next animation frame.

Unfortunately, we rely on synchronously polling the DOM when an editor
view is attached to perform the initial measurement of the default char
width, which is required to position the wrap guide.

In componentWillMount, observing the config was requesting an update,
causing us to skip this synchronous update at attachment time and
position the wrap guide wrong.

This prevents update requests that occur before mount from pausing the
polling that we perform on attachment, restoring correct function to the
wrap guide.
This commit is contained in:
Nathan Sobo
2014-07-28 14:42:35 -06:00
parent 3af3a0d27e
commit 7f882b00f5

View File

@@ -226,6 +226,8 @@ EditorComponent = React.createClass
@performedInitialMeasurement = true
requestUpdate: ->
return unless @isMounted()
if @updatesPaused
@updateRequestedWhilePaused = true
return