From 38b41ced760d0c9cab94df7e8b78cb9cef20644f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 8 Oct 2021 14:51:54 -0500 Subject: [PATCH] TimelineQueueButtonHeader: always scroll to top --- app/soapbox/components/status_list.js | 1 - app/soapbox/components/timeline_queue_button_header.js | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/soapbox/components/status_list.js b/app/soapbox/components/status_list.js index f96ec779f..c843a4b64 100644 --- a/app/soapbox/components/status_list.js +++ b/app/soapbox/components/status_list.js @@ -82,7 +82,6 @@ export default class StatusList extends ImmutablePureComponent { } handleDequeueTimeline = () => { - window.scrollTo({ top: 0, behavior: 'smooth' }); const { onDequeueTimeline, timelineId } = this.props; if (!onDequeueTimeline || !timelineId) return; onDequeueTimeline(timelineId); diff --git a/app/soapbox/components/timeline_queue_button_header.js b/app/soapbox/components/timeline_queue_button_header.js index bb02b0193..25a219336 100644 --- a/app/soapbox/components/timeline_queue_button_header.js +++ b/app/soapbox/components/timeline_queue_button_header.js @@ -55,8 +55,13 @@ class TimelineQueueButtonHeader extends React.PureComponent { } }, 150, { trailing: true }); + handleClick = e => { + window.scrollTo({ top: 0, behavior: 'smooth' }); + this.props.onClick(e); + } + render() { - const { count, message, onClick, intl } = this.props; + const { count, message, intl } = this.props; const { scrolled } = this.state; const visible = count > 0 && scrolled; @@ -67,7 +72,7 @@ class TimelineQueueButtonHeader extends React.PureComponent { return (
- + {(count > 0) && (