From 3d5d7e3a21da34f32d4541916a73a3cc411ebad8 Mon Sep 17 00:00:00 2001 From: josc146 Date: Fri, 28 Apr 2023 17:25:30 +0800 Subject: [PATCH] fix: safari compatibility (#255) --- src/components/ConfirmButton/index.jsx | 4 ++++ src/components/DeleteButton/index.jsx | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/components/ConfirmButton/index.jsx b/src/components/ConfirmButton/index.jsx index 3e2acdf..2f58e09 100644 --- a/src/components/ConfirmButton/index.jsx +++ b/src/components/ConfirmButton/index.jsx @@ -25,6 +25,10 @@ function ConfirmButton({ onConfirm, text }) { style={{ ...(waitConfirm ? {} : { display: 'none' }), }} + onMouseDown={(e) => { + e.preventDefault() + e.stopPropagation() + }} onBlur={() => { setWaitConfirm(false) }} diff --git a/src/components/DeleteButton/index.jsx b/src/components/DeleteButton/index.jsx index 7f0f561..ad5f5b7 100644 --- a/src/components/DeleteButton/index.jsx +++ b/src/components/DeleteButton/index.jsx @@ -28,6 +28,10 @@ function DeleteButton({ onConfirm, size, text }) { fontSize: '10px', ...(waitConfirm ? {} : { display: 'none' }), }} + onMouseDown={(e) => { + e.preventDefault() + e.stopPropagation() + }} onBlur={() => { setWaitConfirm(false) }}