From 74af8c0e91319061fe008c5357cbdba7edd00c4e Mon Sep 17 00:00:00 2001 From: Justin Date: Thu, 3 Mar 2022 10:13:45 -0500 Subject: [PATCH] Fix scroll-to-top on Notifications --- app/soapbox/components/timeline_queue_button_header.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/soapbox/components/timeline_queue_button_header.js b/app/soapbox/components/timeline_queue_button_header.js index 1fa9cbadf..7dcb7a387 100644 --- a/app/soapbox/components/timeline_queue_button_header.js +++ b/app/soapbox/components/timeline_queue_button_header.js @@ -81,8 +81,12 @@ class TimelineQueueButtonHeader extends React.PureComponent { } }, 150, { trailing: true }); - handleClick = e => { + scrollUp = () => { window.scrollTo({ top: 0, behavior: 'smooth' }); + }; + + handleClick = e => { + setTimeout(this.scrollUp, 10); this.props.onClick(e); }