-
-
Notifications
You must be signed in to change notification settings - Fork 667
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
Variable sized sortables stretched when dragged #117
Comments
The items are stretched because you're using In the example you've provided, the layout of your items is not predictable, therefore you won't be able to use any of the built-in sorting strategies, you'd need to build one yourself for that use-case (refer to #44 (comment)). You can however try to re-order the items |
Good to know, thanks for the clarification @clauderic Based on this comment it sounds like you already plan to update the docs--I think that definitely would have helped set me straight.
Thank you! Looks good to me, I'll try this and see how it goes. |
+1 to a doc update -- this GitHub issue saved me. |
this is not working for me:
solution I just realized I had this prop enabled, which disabling actually solved my issue: <DragOverlay adjustScale> |
(Sortable Context) Lưu ý về mảng Items trong component SortableContext clauderic/dnd-kit#183 (comment) (Sensors) Yêu cầu chuột di chuyển 10px thì mới kích hoạt, fix trường hợp click bị gọi event https://docs.dndkit.com/api-documentation/sensors#usesensorLỗi kéo thả phần tử bị stretch khá dị: clauderic/dnd-kit#117 Dung sai của cảm ứng: Tolerance () https://docs.dndkit.com/api-documentation/sensors/touch#delay
I used import {SortableContext, verticalListSortingStrategy} from '@dnd-kit/sortable'
<SortableContext
items={formData.map(field => field.id)}
strategy={verticalListSortingStrategy}
>
// Your sortable items
</ SortableContext> |
Hi @clauderic, sorry for the onslaught of issues this week :)
I have sortables with various heights getting stretched during drag. It looks like the size is being based on the size of the previous item in that position or something else, rather than the item's size?
https://www.loom.com/share/6013cf18e6b44fa2ad3e60826d57f814
Unlike the rectSortingStrategy various sizes demo, I'm not setting the size of my items using CSS grid. The size is determined by the content of each item.
Code Sandbox: https://codesandbox.io/s/dnd-kit-various-sizes-wo-grid-wnxzo
Apologies if this is my mistake or a documented known limit (I looked but didn't see anything).
The text was updated successfully, but these errors were encountered: