Skip to content
Snippets Groups Projects
Unverified Commit b236a5cd authored by Yash Rajpal's avatar Yash Rajpal Committed by GitHub
Browse files

Regression: Scrolling on threads (#28298)

parent 43640a87
No related branches found
No related tags found
No related merge requests found
...@@ -68,9 +68,8 @@ const ThreadMessageList = ({ mainMessage }: ThreadMessageListProps): ReactElemen ...@@ -68,9 +68,8 @@ const ThreadMessageList = ({ mainMessage }: ThreadMessageListProps): ReactElemen
<div <div
className={['thread-list js-scroll-thread', hideUsernames && 'hide-usernames'].filter(isTruthy).join(' ')} className={['thread-list js-scroll-thread', hideUsernames && 'hide-usernames'].filter(isTruthy).join(' ')}
style={{ scrollBehavior: 'smooth' }} style={{ scrollBehavior: 'smooth' }}
onScroll={handleScroll}
> >
<ScrollableContentWrapper ref={listWrapperScrollRef}> <ScrollableContentWrapper ref={listWrapperScrollRef} onScroll={handleScroll}>
<ul className='thread' ref={listRef}> <ul className='thread' ref={listRef}>
{loading ? ( {loading ? (
<li className='load-more'> <li className='load-more'>
......
import type { UIEvent } from 'react'; import type { ScrollValues } from 'rc-scrollbars';
import { useCallback, useEffect, useRef } from 'react'; import { useCallback, useEffect, useRef } from 'react';
export const useLegacyThreadMessageListScrolling = () => { export const useLegacyThreadMessageListScrolling = () => {
...@@ -7,8 +7,8 @@ export const useLegacyThreadMessageListScrolling = () => { ...@@ -7,8 +7,8 @@ export const useLegacyThreadMessageListScrolling = () => {
const atBottomRef = useRef(true); const atBottomRef = useRef(true);
const onScroll = useCallback(({ currentTarget: e }: UIEvent) => { const onScroll = useCallback(({ scrollHeight, scrollTop, clientHeight }: ScrollValues) => {
atBottomRef.current = e.scrollTop >= e.scrollHeight - e.clientHeight; atBottomRef.current = scrollTop >= scrollHeight - clientHeight;
}, []); }, []);
const sendToBottomIfNecessary = useCallback(() => { const sendToBottomIfNecessary = useCallback(() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment