Skip to content

Commit

Permalink
Improve panning and wheel configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
HorusGoul committed Dec 23, 2024
1 parent 2420d23 commit 168b024
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"react-helmet-async": "^1.3.0",
"react-hyper-scroller": "^3.1.0-beta.2",
"react-router-dom": "6.28.0",
"react-zoom-pan-pinch": "^3.0.7",
"react-zoom-pan-pinch": "^3.5.1",
"tailwind-merge": "2.5.5",
"workbox-precaching": "^6.5.4",
"zustand": "^4.3.2"
Expand Down
9 changes: 9 additions & 0 deletions apps/pwa/src/components/periodic-table/PeriodicTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@ function PeriodicTable({ elementRenderer, className }: PeriodicTableProps) {
disabled: true,
}}
ref={reactZoomRef}
wheel={{
step: 0.2,
smoothStep: 0.001,
}}
panning={{
allowRightClickPan: false,
allowMiddleClickPan: false,
velocityDisabled: true,
}}
>
<TransformComponent
contentStyle={{ width: "100%", height: "100%" }}
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

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

0 comments on commit 168b024

Please sign in to comment.