Skip to content

Commit

Permalink
Only respond to stylesheet changes for mounted components
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Sobo committed Dec 11, 2014
1 parent 6a0a694 commit 87efc7e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/text-editor-component.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,9 @@ TextEditorComponent = React.createClass
# reloaded in dev mode. It seems like a workaround for a browser bug, but
# not totally sure.
requestAnimationFrame =>
@refreshScrollbars() if not styleElement.sheet? or @containsScrollbarSelector(styleElement.sheet)
@handleStylingChange()
if @isMounted()
@refreshScrollbars() if not styleElement.sheet? or @containsScrollbarSelector(styleElement.sheet)
@handleStylingChange()

onAllThemesLoaded: ->
@refreshScrollbars()
Expand Down

0 comments on commit 87efc7e

Please sign in to comment.