mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
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:
@@ -226,6 +226,8 @@ EditorComponent = React.createClass
|
||||
@performedInitialMeasurement = true
|
||||
|
||||
requestUpdate: ->
|
||||
return unless @isMounted()
|
||||
|
||||
if @updatesPaused
|
||||
@updateRequestedWhilePaused = true
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user