mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Never assign a 0 height or width when measuring editor scroll view
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user