Remove React Virtualized from <Timeline>
This commit is contained in:
parent
1eafe79905
commit
0c31ad25ef
40 changed files with 798 additions and 2512 deletions
23
ts/util/scrollUtil.ts
Normal file
23
ts/util/scrollUtil.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
// Copyright 2021-2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export const getScrollBottom = (
|
||||
el: Readonly<Pick<HTMLElement, 'clientHeight' | 'scrollHeight' | 'scrollTop'>>
|
||||
): number => el.scrollHeight - el.scrollTop - el.clientHeight;
|
||||
|
||||
export function setScrollBottom(
|
||||
el: Pick<HTMLElement, 'clientHeight' | 'scrollHeight' | 'scrollTop'>,
|
||||
newScrollBottom: number
|
||||
): void {
|
||||
// We want to mutate the parameter here.
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
el.scrollTop = el.scrollHeight - newScrollBottom - el.clientHeight;
|
||||
}
|
||||
|
||||
export function scrollToBottom(
|
||||
el: Pick<HTMLElement, 'scrollHeight' | 'scrollTop'>
|
||||
): void {
|
||||
// We want to mutate the parameter here.
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
el.scrollTop = el.scrollHeight;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue