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