From 7819780f6bb7a590d028066749b00c3f82624a3c Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 16 May 2025 19:13:58 +0800 Subject: [PATCH] Prevent clicks on sandbox --- src/pages/sandbox.css | 5 ----- src/pages/sandbox.jsx | 13 ++++++++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/pages/sandbox.css b/src/pages/sandbox.css index 9957c8b9..202f8048 100644 --- a/src/pages/sandbox.css +++ b/src/pages/sandbox.css @@ -77,11 +77,6 @@ > .status, > *:not(.status-card-link) > .status { - button, - a { - pointer-events: none; - } - > .container > .meta { view-transition-name: status-meta; } diff --git a/src/pages/sandbox.jsx b/src/pages/sandbox.jsx index 4a21833a..2873bd6b 100644 --- a/src/pages/sandbox.jsx +++ b/src/pages/sandbox.jsx @@ -679,7 +679,18 @@ export default function Sandbox() {

Sandbox

-
+
{ + const isAllowed = e.target.closest( + '.media, .media-caption, .spoiler-button, .spoiler-media-button', + ); + if (isAllowed) return; + e.preventDefault(); + e.stopPropagation(); + return false; + }} + > {toggleState.loading ? (