From 5797103438571f5f04ecbbec2fe186ea20edf490 Mon Sep 17 00:00:00 2001 From: Florian Barbin Date: Tue, 13 Feb 2024 11:17:47 +0100 Subject: [PATCH] Fix card dnd issue with visibility --- package.json | 2 +- src/controllers/Lane.js | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index ad454c55..5b48ddd4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ObeoNetwork/react-trello", - "version": "2.4.8", + "version": "2.4.9", "description": "Pluggable components to add a trello like kanban board to your application", "main": "dist/index.js", "files": [ diff --git a/src/controllers/Lane.js b/src/controllers/Lane.js index 1a10b8f0..e5f6a4e0 100644 --- a/src/controllers/Lane.js +++ b/src/controllers/Lane.js @@ -163,9 +163,9 @@ class Lane extends Component { const showableCards = collapsed ? [] : cards const cardList = this.sortCards(showableCards, laneSortFunction).map((card, idx) => { - if (card.visible || card.visible === undefined) { - const onDeleteCard = () => this.removeCard(card.id) - const cardToRender = ( + const onDeleteCard = () => this.removeCard(card.id) + const cardToRender = + card.visible || card.visible === undefined ? ( - ) - return cardDraggable && (!card.hasOwnProperty('draggable') || card.draggable) ? ( - {cardToRender} - ) : ( - {cardToRender} - ) - } + ) : null + return cardDraggable && (!card.hasOwnProperty('draggable') || card.draggable) ? ( + {cardToRender} + ) : ( + {cardToRender} + ) }) return ( @@ -278,6 +277,7 @@ class Lane extends Component { editable, editLaneTitle, collapsed: collapsedProps, + onLaneCollapseUpdate, ...otherProps } = this.props const allClassNames = classNames('react-trello-lane', this.props.className || '')