Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inertia sometimes goes backwards when applying restrictEdges modifier inside aspectRatio modifier #997

Open
WinslowJosiah opened this issue Feb 28, 2023 · 0 comments

Comments

@WinslowJosiah
Copy link

WinslowJosiah commented Feb 28, 2023

While trying to figure out a workaround for #805, I came across a strange issue with inertia while trying to combine aspectRatio and restrictEdges. This only seems to occur if the restrictEdges modifier is applied inside the aspectRatio modifier; if the two are separately applied in any order, one will sometimes fail to be respected (as the docs warn), but this issue with inertia does not occur.

Minimal JSFiddle: https://jsfiddle.net/t2nore5h/2/

Expected behavior

While resizing the blue div, if the mouse button is released while the cursor is accelerating in any direction, the div should continue to be resized in that same direction for a bit.

Actual behavior

When resizing the blue div, the direction of resizing shifts backwards while inertia is being applied. This happens when resizing the div either horizontally or diagonally; in testing, I was only able to get this to happen when resizing vertically with a very high acceleration.
This is easiest to notice if the div at its minimum size, and it is attempted to be resized smaller with inertia; the div should not change size, but it will in fact get bigger!

System configuration

interact.js version: 1.10.17
Browser name and version: Chrome Version 110.0.5481.105 (Official Build) (64-bit)
Operating System: Windows 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant