From a271e52a4e9eb92426bc4d64d8b65ad3eea2b945 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 18 Apr 2014 16:24:30 -0600 Subject: [PATCH] Never assign a 0 height or width when measuring editor scroll view --- src/editor-scroll-view-component.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/editor-scroll-view-component.coffee b/src/editor-scroll-view-component.coffee index ba2a50755..c4db12bb2 100644 --- a/src/editor-scroll-view-component.coffee +++ b/src/editor-scroll-view-component.coffee @@ -182,15 +182,17 @@ EditorScrollViewComponent = React.createClass measureHeightAndWidth: -> return unless @isMounted() - {editor} = @props node = @getDOMNode() computedStyle = getComputedStyle(node) + {editor} = @props unless computedStyle.height is '0px' - editor.setHeight(node.clientHeight) + clientHeight = node.clientHeight + editor.setHeight(clientHeight) if clientHeight > 0 unless computedStyle.width is '0px' - editor.setWidth(node.clientWidth) + clientWidth = node.clientWidth + editor.setWidth(clientWidth) if clientHeight > 0 focus: -> @refs.input.focus()