From 9ff01403ea03e4a56a0c11a054b8e7ebd0c22d87 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 29 Nov 2024 15:04:22 +0100 Subject: [PATCH] Fix middle-click handling conflicting with automatic scrolling (#33106) --- app/javascript/mastodon/components/status.jsx | 2 +- app/javascript/mastodon/components/status_content.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/components/status.jsx b/app/javascript/mastodon/components/status.jsx index 669eb22cb6..cf6fe86c3d 100644 --- a/app/javascript/mastodon/components/status.jsx +++ b/app/javascript/mastodon/components/status.jsx @@ -173,7 +173,7 @@ class Status extends ImmutablePureComponent { handleMouseUp = e => { // Only handle clicks on the empty space above the content - if (e.target !== e.currentTarget) { + if (e.target !== e.currentTarget && e.detail >= 1) { return; } diff --git a/app/javascript/mastodon/components/status_content.jsx b/app/javascript/mastodon/components/status_content.jsx index fe485eb3ac..6b06b938de 100644 --- a/app/javascript/mastodon/components/status_content.jsx +++ b/app/javascript/mastodon/components/status_content.jsx @@ -204,7 +204,7 @@ class StatusContent extends PureComponent { element = element.parentNode; } - if (deltaX + deltaY < 5 && (e.button === 0 || e.button === 1) && this.props.onClick) { + if (deltaX + deltaY < 5 && (e.button === 0 || e.button === 1) && e.detail >= 1 && this.props.onClick) { this.props.onClick(e); }