react-beautiful-dnd icon indicating copy to clipboard operation
react-beautiful-dnd copied to clipboard

I can't get the element.

Open GrayOrchid opened this issue 1 year ago • 1 comments

I have three to-do lists and when I swap cases within one list, the last case in the list cannot be dragged and dropped. You can't interact with it in any way at all. And when I try to grab an item in the console I get this warning react-beautiful-dnd.esm.js:39 react-beautiful-dndUnable to find draggable with id: 654621428283905c5b2012adb3. I have each case has a unique id.

GrayOrchid avatar Nov 04 '23 13:11 GrayOrchid

Apparently my problem was solved I needed to add the key

  1. {todos?.tasks?.map((task, index) => (
  2.                     <Draggable index={index} key={task._id} draggableId={task._id.toString()}>
    
  3.                         {(provided) => (
    
  4.                             <div className='todos__task'
    
  5.                                 {...provided.draggableProps}
    
  6.                                 {...provided.dragHandleProps}
    
  7.                                 ref={provided.innerRef} >
    
  8.                                 {provided.placeholder}
    
  9.                                 <h1 className='todos__task-title'>{task?.title}</h1>
    
  10.                             </div>
    
  11.                         )}
    
  12.                     </Draggable>
    
  13.                 ))}
    

GrayOrchid avatar Nov 06 '23 14:11 GrayOrchid