moveable
moveable copied to clipboard
Snap settings with `keepRatio` set to `false` are not honored
Environments
Framework name: StimulusJS Framework version: 3.2.1 Moveable Component version: 0.51.1 Selecto Component version: 1.26.0 Testable Address(optional): https://codepen.io/davidalejandroaguilar/pen/VwVNxWz
Description
When resizing selected elements with snap settings (snapGridWidth, snapGridHeight, snapThreshold, snapRotationThreshold, snapRotationDegrees) and keepRatio set to false, the elements no longer respect snap settings (50px snapping in the example Codepen).
In the video below, you can see how each individual element can only be resized in 50px increments, however, when both are resized at the same time, they are no longer snapping correctly, and they end up outside the grid.
https://github.com/daybrush/moveable/assets/15317732/4299c49a-e0b6-4ffc-8798-6a0225f6ca74
@daybrush Just bringing this into your attention, seems like it's a bug?
EDIT: Oops, sorry, just noticed you were on vacation, my bad and hope you enjoyed them! 🏖️
@davidalejandroaguilar
sorry. I couldn't care much.
your expected behavior
If keepRatio (false) and snapGridWidth and snapGridHeight are set, you want snapGrid to work individually, not on a group basis, right?
@daybrush I think so, yes.
Each individual element must stay within the grid, even when resizing as a group.
@davidalejandroaguilar
croact-moveable0.8.0@moveable/helper0.1.3lit-moveable0.29.0moveable0.52.0preact-moveable0.54.0react-moveable0.55.0svelte-moveable0.44.0vue-moveable2.0.0-beta.86vue3-moveable0.27.0ngx-moveable0.49.0
moveable's new version is released. snapGridAll prop is added. Use snapGridAll prop to true.