Movable - Cannot limit delta for only 1 axis.
axekan opened this issue · comments
Repl: https://svelte.dev/repl/f953c2b739d549a28c167872a2e9df03?version=4.2.10
My use case is a movable that can only be moved on the x-axis. My issues are these:
- The
x
value indelta
cannot be omitted (since that gives an error), so I have to set that to something arbitrary too. - Setting
y
to '0px' makes the delta not apply at all. I can set it to something small like1px
, but I would like to avoid that entirely.
I would like to to just be able to:
<div
use:movable={{ limit: { delta: { y: '0px' } } }}>
...
</div>
Is there a workaround to be able to do this currently?
@axekan Hello there. Thanks for the report. That was indeed not accounted for previously but is now doable in the newly released v3.2.0.
Your REPL now works as expected. You can also just set limit.detla.y
to 0
instead of '0px'
to save a few keystrokes.
Happy coding!
p.s closing for now but feel free to reopen / continue discussion if necessary. Thanks!