mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-20 22:23:53 +08:00
fix(list-tabular): Invariant error caused by onDoneReceivingScrollEvents
This commit is contained in:
parent
6dacda4a69
commit
a745681684
1 changed files with 5 additions and 4 deletions
|
@ -78,6 +78,9 @@ class ListTabular extends React.Component
|
|||
componentDidMount: =>
|
||||
@updateRangeState()
|
||||
|
||||
componentWillUnmount: =>
|
||||
clearTimeout(@_scrollTimer) if @_scrollTimer
|
||||
|
||||
componentDidUpdate: (prevProps, prevState) =>
|
||||
# If our view has been swapped out for an entirely different one,
|
||||
# reset our scroll position to the top.
|
||||
|
@ -92,10 +95,8 @@ class ListTabular extends React.Component
|
|||
|
||||
# Create an event that fires when we stop receiving scroll events.
|
||||
# There is no "scrollend" event, but we really need one.
|
||||
@_scrollTick ?= _.debounce =>
|
||||
@onDoneReceivingScrollEvents()
|
||||
, 100
|
||||
@_scrollTick()
|
||||
clearTimeout(@_scrollTimer) if @_scrollTimer
|
||||
@_scrollTimer = setTimeout(@onDoneReceivingScrollEvents, 100)
|
||||
|
||||
# If we just started scrolling, scrollInProgress changes our CSS styles
|
||||
# and disables pointer events to our contents for rendering speed
|
||||
|
|
Loading…
Reference in a new issue