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

SortableProvider doesn't like "0" as an ID #116

Open
benbriedis opened this issue Jul 22, 2024 · 3 comments
Open

SortableProvider doesn't like "0" as an ID #116

benbriedis opened this issue Jul 22, 2024 · 3 comments

Comments

@benbriedis
Copy link

I have an example here: https://stackblitz.com/edit/solidjs-templates-uekvqb
If you drag around the row with the '0' ID then a gap is not made for it in the list.
You can drop the item OK.

@martinpengellyphillips
Copy link
Contributor

Thanks for the report and reproduction. I'll take a look.

@martinpengellyphillips
Copy link
Contributor

From a quick look I imagine it is caused by this naive check here:

if (dndState.active.draggableId && dndState.active.droppableId) {

I'll fix that to be stricter (and avoid treating a 0 as a false evaluation).

@floratmin
Copy link

From a quick look I imagine it is caused by this naive check here:

if (dndState.active.draggableId && dndState.active.droppableId) {

I'll fix that to be stricter (and avoid treating a 0 as a false evaluation).

Yes this fix works.

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

3 participants