Skip to content

Commit

Permalink
Merge pull request #6038 from melloware/PR6037
Browse files Browse the repository at this point in the history
Fix #6037: Image stop click propagation on preview buttons
  • Loading branch information
nitrogenous committed Mar 18, 2024
2 parents 8a1cd1e + 94d082f commit 364a24e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions components/lib/image/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,31 @@ 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;

return prevScale + 0.1;
});
};

const zoomOut = () => {
const zoomOut = (event) => {
event.stopPropagation();

setScaleState((prevScale) => {
if (zoomOutDisabled) return prevScale;

Expand Down

0 comments on commit 364a24e

Please sign in to comment.