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

My items get deformed when using a sortable list #1528

Open
Ivnoff1 opened this issue Nov 14, 2024 · 2 comments
Open

My items get deformed when using a sortable list #1528

Ivnoff1 opened this issue Nov 14, 2024 · 2 comments

Comments

@Ivnoff1
Copy link

Ivnoff1 commented Nov 14, 2024

Hi guys, I am developing a kanban board, in which I have tasks with a sortable function, I have a bug and it is that when moving an item to a new column if it is placed on another item, they overlap and the item is deformed.

It seems that I noticed that the problem lies in the style property :

const style = {
    transition,
    transform: CSS.Transform.toString(transform),
}


I tried modifying the property:

const style = useMemo(() => {
return {
    ...(isDragging ? { transform: CSS.Translate.toString(transform) } : null),
    transition,
}

}, [isDragging, transform, transition])

The deformation problem is solved, but the display area continues to overlap with other items,

I'm not sure if the real problem is in the style property of the item or lies in my SortableContext or in the new set task array

Please if anyone knows a solution I would be happy to know it
Reproductor multimedia 13_11_2024 11_36_55 p  m
Reproductor multimedia 13_11_2024 11_37_46 p  m
Reproductor multimedia 13_11_2024 11_38_11 p  m

@mireiaespuga
Copy link

Do this and it should allow the movement of the item while maintaining scale

 const style = {
    transform: CSS.Transform.toString(
      transform
        ? {
            ...transform,
            scaleX: 1,
            scaleY: 1,
          }
        : null,
    ),
    transition,
  }
  

@Ivnoff1
Copy link
Author

Ivnoff1 commented Nov 14, 2024

@mireiaespuga
Thanks, I tried it and it worked, the elements are no longer deformed, it's great!

only now I have a new bug that is somewhat interesting, and that is that when I change an item to a new column, the green preview item overlaps with other items,

I think the problem no longer comes from the style property, but I can't find the real problem.

if you can help me that would be amazing

IMG_7749
IMG_7750

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

2 participants