From 94d082fdcdc3f7f2fd5d246755cee5c24d5fe90e Mon Sep 17 00:00:00 2001 From: melloware Date: Fri, 23 Feb 2024 16:17:39 -0500 Subject: [PATCH] Fix #6037: Image stop click propagation on preview buttons --- components/lib/image/Image.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/components/lib/image/Image.js b/components/lib/image/Image.js index 273de66245..37379c5226 100644 --- a/components/lib/image/Image.js +++ b/components/lib/image/Image.js @@ -105,15 +105,21 @@ export const Image = React.memo( DomHandler.saveAs({ name, src }); }; - const rotateRight = () => { + const rotateRight = (event) => { + event.stopPropagation(); + setRotateState((prevRotate) => prevRotate + 90); }; - const rotateLeft = () => { + const rotateLeft = (event) => { + event.stopPropagation(); + setRotateState((prevRotate) => prevRotate - 90); }; - const zoomIn = () => { + const zoomIn = (event) => { + event.stopPropagation(); + setScaleState((prevScale) => { if (zoomInDisabled) return prevScale; @@ -121,7 +127,9 @@ export const Image = React.memo( }); }; - const zoomOut = () => { + const zoomOut = (event) => { + event.stopPropagation(); + setScaleState((prevScale) => { if (zoomOutDisabled) return prevScale;