mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Don't measure height and width unless component is mounted
Since we measure in requestAnimationFrame, it's possible to request measurement prior to be unmounted and have it occur afterward.
This commit is contained in:
@@ -180,6 +180,8 @@ EditorScrollViewComponent = React.createClass
|
||||
# and use the scrollHeight / scrollWidth as its height and width in
|
||||
# calculations.
|
||||
measureHeightAndWidth: ->
|
||||
return unless @isMounted()
|
||||
|
||||
{editor} = @props
|
||||
node = @getDOMNode()
|
||||
computedStyle = getComputedStyle(node)
|
||||
|
||||
Reference in New Issue
Block a user