react-trello
react-trello copied to clipboard
Error while drag and drop a card in different lane
Describe the bug Getting 'index.js:82 Uncaught TypeError: Cannot read property 'laneId' of undefined' error while card drag and drop functionality.
To Reproduce Steps to reproduce the behavior:
- updating my redux state when onCardMoveAcrossLanes() fires data
Desktop (please complete the following information):
- OS: MacOS Mojave
- Browser: chrome
Additional context I have my redux state which updates on card actions. Add card to lane, add lane, reorder lanes and rest functionality are working.
I have the same issue, but in my case I use "getderivedstate" to map my business objects to "board ones". And when I move a card to a different lane I get this error, and the dnd feature stops working.
Let us know if you've found a solution please.
ok, more information about this issue here: When I move tasks within the same lane everything works just fine, but when I move them to a different lane I get the error above.
@orlandovallejos Same thing, man. I am trying to find a solution.
onCardMoveAcrossLanes
is not even called, but handleDragEnd
works fine.
Same thing here, someone already found the solution?
Same here. Anyone found at least a workaround already?
ok, this is what I did (not the best solution, but it works for me)
I use the handleDragEnd
method, and call my api to update my record on the database. But, I always return false
! This will prevent the card to make the move, but I count on my state to be updated once the api returns a successful request. So, I get my state updated and the card is moved to the right position.
I told you it's not the best solution. But it works.
Here's some code:
<Board
...my other props here
handleDragEnd={this.handleDragEnd}
/>
</Board>
And in my method:
handleDragEnd = (moveParamsFromThisComponent) => {
// Call my action, it will make the api call, and eventually update my state in redux:
// This will prevent to drop the task:
return false;
};
I am getting the same error, not using any callbacks right now just populating the cards from my API response. Also noticed that this does not happen with the cards created using the add new card
button on the board
Looks similar to #66
I'm having this issue too. There is no workaround for this?