Skip to content

Commit

Permalink
Merge pull request #149 from sasza2/feat/element-disabled-move-prop
Browse files Browse the repository at this point in the history
feat: element disabled move prop
  • Loading branch information
sasza2 authored Mar 25, 2024
2 parents 72f5846 + cbe8e1a commit 8e18a23
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-mails-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sasza/react-panzoom": minor
---

element disabledMove prop
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@
"react": ">=16.14.0"
},
"dependencies": {
"panzoom-core": "1.6.0"
"panzoom-core": "1.7.0"
}
}
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Element.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const Element: React.FC<ElementProps> = ({
children,
className,
disabled,
disabledMove,
draggableSelector,
family,
followers,
Expand All @@ -34,6 +35,7 @@ const Element: React.FC<ElementProps> = ({
className: className || 'react-panzoom-element',
id,
disabled,
disabledMove,
draggableSelector,
family,
followers,
Expand Down Expand Up @@ -64,6 +66,7 @@ const Element: React.FC<ElementProps> = ({
elementRef.current.setOptions(options);
}, [
disabled,
disabledMove,
draggableSelector,
family,
initialized,
Expand Down
3 changes: 2 additions & 1 deletion types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export type PanZoomOptions = {
zoomInitial?: number;
zoomMax?: number;
zoomMin?: number;
zoomPosition?: ZoomPosition;
zoomPosition?: ZoomPosition | null;
zoomSpeed?: number;
} & Size

Expand Down Expand Up @@ -164,6 +164,7 @@ type ElementOnContextMenu = (
export type ElementOptions = {
className?: string;
disabled?: boolean;
disabledMove?: boolean;
draggableSelector?: string;
family?: string;
followers?: Array<ElementId>;
Expand Down

0 comments on commit 8e18a23

Please sign in to comment.