interact.js icon indicating copy to clipboard operation
interact.js copied to clipboard

[Feature request] add a way to make snap-grid work with scrolling

Open Anubarak opened this issue 4 years ago • 1 comments

If you have questions about the API that aren't answered in the docs or FAQ, try asking in the Gitter chatroom or on Stackoverflow.

If you've found something that looks like a bug, include a link to a minimal demo on JSFilddle, Codepen with instructions to reproduce the bug with and roughly follow the following issue description format:

https://codesandbox.io/s/wizardly-currying-fko17?file=/src/index.js When you have snap enabled and want to scroll, the element does not scroll along with the window. I know there is a workaround here https://github.com/taye/interact.js/issues/568 but that's not working for grids, I already searched for a function to recalculate the position based on the grid but I wasn't able to find a public function to convert the current position to the grid snap position

const snap = interact.modifiers.snap({
    targets: [
        interact.snappers.grid({x: 30, y: 30})
    ],
    // range: Infinity,
    relativePoints: [{x: 0, y: 0}]
});

snap.getPosition(target)

would be awesome. We are willing to buy the pro version if it's available there.

Expected behavior

The element should scroll accordingly in the grid

Actual behavior

Nothing happens

System configuration

interact.js version: 1.10.11 Browser name and version: Version 95.0.4638.69 (Official Build) (64-bit) Operating System: Windows 10

Anubarak avatar Nov 15 '21 10:11 Anubarak

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 02 '22 10:03 stale[bot]