Skip to content

Commit

Permalink
Fix primefaces#6037: Image stop click propagation on preview buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Feb 23, 2024
1 parent a2a2f11 commit 94d082f
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 94d082f

Please sign in to comment.