Skip to content

Conversation

@capi1O
Copy link

@capi1O capi1O commented Aug 5, 2021

This add the options lastSnapPointX and lastSnapPointY which when set will disable scroll snapping after the point (integer value).

For example If I have a website with vertical layout, passing lastSnapPointY: 5 will snap normally for the 5 first snap points and then scrolling will be normal/free/without snapping.

Fixes issue #48

Copy link
Owner

@lucafalasco lucafalasco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to avoid running the scrolling function completely when the condition is met, instead of changing the scrollTo coordinates.

@capi1O
Copy link
Author

capi1O commented Aug 9, 2021

I agree 😄 (I was actually surprised it worked). The problem is I did not manage to get it working (quickly). I tried to return in animationHandler but I needed the values currentPoint.x/y computed in getNextSnapPoint for the condition so I put the logic there. I will not work on the PR now due to lack of time but I will update it if you decide this option "lastSnapPoint" is worth it, that is if you are not planning to add an option to have an array of snapDestionations.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no suggestions.

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

Successfully merging this pull request may close these issues.

2 participants