mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
fix(scroll-region): Handle edge case where React nodes are not available (Sentry 2763)
This commit is contained in:
parent
1a5dd2003f
commit
ba00ad9cbe
1 changed files with 3 additions and 1 deletions
|
@ -50,6 +50,7 @@ class Scrollbar extends React.Component
|
|||
_recomputeDimensions: ({avoidForcingLayout}) =>
|
||||
if not avoidForcingLayout
|
||||
trackNode = React.findDOMNode(@refs.track)
|
||||
return unless trackNode
|
||||
trackHeight = trackNode.clientHeight
|
||||
if trackHeight isnt @state.trackHeight
|
||||
@setState({trackHeight})
|
||||
|
@ -282,8 +283,9 @@ class ScrollRegion extends React.Component
|
|||
|
||||
_recomputeDimensions: ({avoidForcingLayout}) =>
|
||||
return unless @refs.content
|
||||
|
||||
contentNode = React.findDOMNode(@refs.content)
|
||||
return unless contentNode
|
||||
|
||||
viewportScrollTop = contentNode.scrollTop
|
||||
|
||||
# While we're scrolling, calls to contentNode.scrollHeight / clientHeight
|
||||
|
|
Loading…
Reference in a new issue