FIX: ensures scrollable-list is passing scroller element (#36736)

Following idle pane refactoring we incorrectly were expecting the
scroller from the scrollable-list when we now expect the component
(chat-channel/chat-thread) to pass it down.

We have tests for this behavior generally but testing the exact
scrolling moment is generally brittle, I won't add another test for now.
This commit is contained in:
Joffrey JAFFEUX
2025-12-17 00:08:47 +01:00
committed by GitHub
parent 726fc21187
commit 4689abf46c
3 changed files with 12 additions and 3 deletions
@@ -475,6 +475,7 @@ export default class ChatChannel extends Component {
DatesSeparatorsPositioner.apply(this.scroller);
this.paneState.updatePendingContentFromScrollState({
scroller: this.scroller,
fetchedOnce: this.messagesLoader.fetchedOnce,
canLoadMoreFuture: this.messagesLoader.canLoadMoreFuture,
state,
@@ -506,6 +507,7 @@ export default class ChatChannel extends Component {
this.chatChannelScrollPositions.delete(this.args.channel.id);
} else {
this.paneState.updatePendingContentFromScrollState({
scroller: this.scroller,
fetchedOnce: this.messagesLoader.fetchedOnce,
canLoadMoreFuture: this.messagesLoader.canLoadMoreFuture,
state,
@@ -133,6 +133,7 @@ export default class ChatThread extends Component {
DatesSeparatorsPositioner.apply(this.scroller);
this.paneState.updatePendingContentFromScrollState({
scroller: this.scroller,
fetchedOnce: this.messagesLoader.fetchedOnce,
canLoadMoreFuture: this.messagesLoader.canLoadMoreFuture,
state,
@@ -163,6 +164,7 @@ export default class ChatThread extends Component {
this.fetchMoreMessages({ direction: FUTURE });
} else {
this.paneState.updatePendingContentFromScrollState({
scroller: this.scroller,
fetchedOnce: this.messagesLoader.fetchedOnce,
canLoadMoreFuture: this.messagesLoader.canLoadMoreFuture,
state,
@@ -173,11 +173,16 @@ export default class ChatPaneState {
* @param {number} [options.distanceThresholdPixels]
*/
updatePendingContentFromScrollState(options) {
const { fetchedOnce, canLoadMoreFuture, state, distanceThresholdPixels } =
options;
const {
scroller,
fetchedOnce,
canLoadMoreFuture,
state,
distanceThresholdPixels,
} = options;
this.#updateHasPendingContentBelow({
scroller: state?.scroller,
scroller,
fetchedOnce,
canLoadMoreFuture,
distanceToBottomPixels: state?.distanceToBottom?.pixels ?? 0,