最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - react-beautiful-dnd: When multiple lists exists, dragging content in one row will drag same index from all rows - S

programmeradmin1浏览0评论

I have a simple react-beautiful-dnd app where I have multiple rows, and you can drag ponents within their own rows.

My issue is that when I drag a Draggable within one row, the visual effect of content moving and the Dragged ponent disappearing happens on every row.

Here is a gif demonstrating my issue:

And here is a codesandbox with an interactive demonstration of the issue, with a step-by-step to reproduce the problem:

;hidenavigation=1&theme=dark

I have a simple react-beautiful-dnd app where I have multiple rows, and you can drag ponents within their own rows.

My issue is that when I drag a Draggable within one row, the visual effect of content moving and the Dragged ponent disappearing happens on every row.

Here is a gif demonstrating my issue:

And here is a codesandbox with an interactive demonstration of the issue, with a step-by-step to reproduce the problem:

https://codesandbox.io/s/r-b-d-try-2-wgscc?fontsize=14&hidenavigation=1&theme=dark

Share Improve this question edited Jan 16, 2020 at 19:11 damon asked Jan 16, 2020 at 18:54 damondamon 2,8978 gold badges28 silver badges35 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

I think your issue is caused by reusing draggable ids. Your ids are currently based on the index of the square. These will be repeated for your different rows. Try moving over to a unique id for each square

See here for more details: https://github./atlassian/react-beautiful-dnd/blob/master/docs/guides/identifiers.md

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论