daybrush / infinite-viewer

Infinite Viewer is Document Viewer Component with infinite scrolling.
https://daybrush.com/infinite-viewer/
MIT License
283 stars 30 forks source link

Zooming is not working for Lit element #42

Closed zsoerenm closed 1 year ago

zsoerenm commented 1 year ago

Unfortunately, zooming isn't working for Lit-element. I tried using the already available lit-infinite-viewer package as well as my own implementation. In both cases holding ctrl while scolling does nothing (the scale value in transform doesn't change). Am I doing something wrong? I tried Firefox and Chromium.

I have created a Codesandbox: https://codesandbox.io/s/broken-rain-cq8ei5?file=/src/my-component.ts

daybrush commented 1 year ago

@zsoerenm

Try useAutoZoom prop.

html`<lit-infinite-viewer .useAutoZoom=${true}>...</lit-infinite-viewer>`
zsoerenm commented 1 year ago

Thanks! I also needed to add .wheelScale=${0.001}. Otherwise the scale went from 1 to 0.001 in a single scroll step.