J. Ryan Stinnett
3a428efb60
Abort scroll updates when already unmounted
...
This checks whether we're unmounted before updating scroll state, as we use
async functions and timeouts in this area.
Fixes https://github.com/vector-im/riot-web/issues/11150
2019-10-18 18:01:57 +01:00
Michael Telatynski
abf111ecbd
Migrate away from React.createClass for non-auth structures. React 16 :D
...
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-08-30 10:34:59 +01:00
Bruno Windels
14caed62d0
make sure scrollpanel is mounted before checking scroll
...
have seen errors in this direction, so hope this will fix it,
as this is invoked from any EventTile's onHeightChanged callback,
which is often called after some async operation (by when the
timeline can be unmounted already).
doesn't hurt in any case.
2019-07-02 17:29:37 +02:00
Bruno Windels
fee8d79267
comment for PAGE_SIZE
2019-04-03 09:16:30 +02:00
Bruno Windels
86c13b97ce
increase PAGE_SIZE so users can scroll up already while waiting for pag.
2019-04-02 17:54:14 +02:00
Bruno Windels
726e91101a
allow fractional values for scrollTop above and below expected value
2019-04-02 17:53:53 +02:00
Bruno Windels
8e4a06db77
round scrollTop upwards to prevent never detecting bottom
2019-03-29 16:41:10 +01:00
Bruno Windels
1a264006f7
turn off debug logging
2019-03-28 18:42:49 +01:00
Bruno Windels
5d53913e35
fix filling conditions
2019-03-27 11:35:38 +01:00
Bruno Windels
f2f3661b7e
more debug logging
2019-03-26 17:40:24 +01:00
Bruno Windels
46f5f872c4
implement scrolling to a token (best effort)
2019-03-26 15:51:02 +01:00
Bruno Windels
805539fdc7
remove timestamp logging in profiler
2019-03-26 13:44:39 +01:00
Bruno Windels
82a9b348c0
add some comments and initialization for async filling
2019-03-26 13:39:18 +01:00
Bruno Windels
18b5041ed2
try filling async instead of sync in scroll handler
...
see if that avoids jumps
2019-03-26 12:19:30 +01:00
Bruno Windels
8f7170a4a1
add timeline profiling markers when updateheight and onscroll run
2019-03-25 12:47:08 +01:00
Bruno Windels
c9c2519240
log scroll events
2019-03-22 15:47:04 +01:00
Bruno Windels
4bfdbe3094
fix jumping when unfilling the top while scrolling down
2019-03-22 15:23:21 +01:00
Bruno Windels
ab49bc4fcf
fix comment typo
2019-03-21 15:37:35 +01:00
Bruno Windels
680afc5ce0
fix scrollToToken alignment
2019-03-21 15:37:06 +01:00
Bruno Windels
3e13a11372
restore scroll position after hiding typing notifs with checkScroll
2019-03-20 17:38:05 +01:00
Bruno Windels
02a5aa3b1f
more logging cleanup
2019-03-20 17:15:43 +01:00
Bruno Windels
9da13fe430
small cleanup
2019-03-20 17:13:09 +01:00
Bruno Windels
a8b149cfbb
cleanup scrollpanel logging
2019-03-20 17:12:49 +01:00
Bruno Windels
460f9a5959
comment typo
2019-03-20 17:10:38 +01:00
Bruno Windels
f164a78eaa
reimplement typing notif timeline shrinking prevention
...
instead of setting a min-height on the whole timeline,
track how much height we need to add to prevent shrinking
and set paddingBottom on the container element of the timeline.
2019-03-20 17:10:30 +01:00
Bruno Windels
1e372aad47
only log when node was found
2019-03-20 11:10:04 +01:00
Bruno Windels
c306181fcd
take into account that node might not be in DOM while updating height
2019-03-20 11:00:27 +01:00
Bruno Windels
88f039fe44
keep track of current updateHeight request outside of method
...
it's only called from one place
2019-03-20 10:59:55 +01:00
Bruno Windels
2bcced72ad
take (potentially clipped) content height into account for filling
2019-03-19 16:51:39 +01:00
Bruno Windels
469511aa44
correctly calculate last node in viewport
...
these variables are now relative to bottom of timeline,
before it was the top
2019-03-19 16:50:55 +01:00
Bruno Windels
71f6b08b26
first impl of new scrolling, still a bit broken
2019-03-19 13:42:22 +01:00
Bruno Windels
d84003ac44
dont break room directory and search
2019-03-18 14:05:56 +01:00
Bruno Windels
891e343df6
create ResizeNotifier to derive which areas of the app resize and emit
2019-03-15 10:16:21 +01:00
Bruno Windels
30d848b86e
use AutoHideScrollbar in ScrollPanel
2019-03-15 10:16:21 +01:00
Bruno Windels
10496cd4e8
also remove disconnecting from ResizeObserver
2019-03-11 10:32:30 +01:00
Bruno Windels
98a3f7db0f
remove resizeobserver code
...
seems to cause more harm than good in some cases and we shouldn't need
it if we get our calls to onHeightChanged in order.
2019-03-07 17:22:27 +01:00
Bruno Windels
89b044f5d8
clearer naming in ScrollPanel
2019-03-07 17:02:19 +01:00
Bruno Windels
66b9363466
clear min-height for typing notifs when the timeline viewport changes size
2019-03-05 16:14:38 +01:00
Bruno Windels
37593c117a
Revert "remove fix for old chrome bug"
...
This reverts commit ecb074862e
.
2019-03-01 16:08:41 +01:00
Bruno Windels
0c06a702dc
pr feedback
2019-02-28 16:05:55 +01:00
Bruno Windels
c920dd2e8a
check top of node instead of bottom, since coming in from last
...
as we're approaching from the last node, if we're scrolled up,
the first node we encounter would be below the bottom of the viewport
change the logic to stop at the first node that has its top
above the viewport bottom.
When completely scrolled up, this was causing nodes way below
the viewport to be selected as the reference for the pixelOffset,
and when pagination came in, it would immediately try to apply
the big negative pixelOffset, scrolling to a negative scrollTop,
thus going to the top again, and triggering another pagination,
entering in an infinite pagination loop until you scrolled down.
2019-02-26 16:26:24 +01:00
Bruno Windels
ba5f16358f
fall back to InteractionObserver for detecting timeline resizes
...
this is not nearly as smooth as using ResizeObserver, as the
callback rate is a lot lower, but seems to be quite a bit better
than what we have right now, without the 7% cpu hog that
the requestAnimationFrame polling fallback has.
2019-02-26 10:49:03 +01:00
Bruno Windels
3823642863
some cleanup
2019-02-26 10:49:03 +01:00
Bruno Windels
41ae618d0e
only clear min-height on scroll & adding items (componentDidUpdate)
...
before we would clear it as soon as you were 1px away from
the bottom of the timeline, which would still create jumping as
the whitespace would around 36px. To play it safe, we only clear it
after moving 200px from the bottom.
Also include "local echo" scroll events, caused by setting scrollTop
2019-02-26 10:49:03 +01:00
Bruno Windels
03784e586c
replace getBoundingClientRect() with offset/scrollTop & clientHeight
...
as they are an order of magnitude faster in most browsers,
getBoundingClientRect() tends to cause relayout.
2019-02-26 10:49:03 +01:00
Bruno Windels
ecb074862e
remove fix for old chrome bug
2019-02-26 10:49:03 +01:00
Bruno Windels
b3e6cbfddd
restore scroll state when timeline resizes using ResizeObserver
...
(only where supported, polyfill doesn't give good results)
2019-02-26 10:49:03 +01:00
Bruno Windels
9e260ad96b
make sure we're at the bottom, although that seems to always be the case in this branch?
2019-02-14 16:19:58 +01:00
Bruno Windels
790e752b7a
clear min-height on scroll
2019-02-14 16:11:38 +01:00
Bruno Windels
3d393b654b
clear min-height on ScrollPanel::componentDidUpdate to catch all cases
2019-02-04 18:27:22 +00:00