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

Fix: Allow snapping to the first snap point #223

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

suphon-t
Copy link
Contributor

@suphon-t suphon-t commented Jan 22, 2024

Fixes #222

The condition here checks that newIndex is not null by truthiness, but it could fail when newIndex is 0 (which is a valid value) as well.
I've changed the fallback value of newIndex to -1 to be inline with findIndex returning -1 when there is no match, and updated the check accordingly.

Copy link

vercel bot commented Jan 22, 2024

@suphon-t is attempting to deploy a commit to the emil Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Jan 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vaul ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 23, 2024 3:03pm

@emilkowalski emilkowalski merged commit 7f9b5d0 into emilkowalski:main Jan 23, 2024
3 checks passed
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.

Can't snap to the first snap point using activeSnapPoint
2 participants