Skip to content

Commit

Permalink
Fix card dnd issue with visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
florianbarbin committed Feb 13, 2024
1 parent 1eac2f9 commit 5797103
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
20 changes: 10 additions & 10 deletions src/controllers/Lane.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? (
<components.Card
key={card.id}
index={idx}
Expand All @@ -181,13 +181,12 @@ class Lane extends Component {
t={t}
{...card}
/>
)
return cardDraggable && (!card.hasOwnProperty('draggable') || card.draggable) ? (
<Draggable key={card.id}>{cardToRender}</Draggable>
) : (
<span key={card.id}>{cardToRender}</span>
)
}
) : null
return cardDraggable && (!card.hasOwnProperty('draggable') || card.draggable) ? (
<Draggable key={card.id}>{cardToRender}</Draggable>
) : (
<span key={card.id}>{cardToRender}</span>
)
})

return (
Expand Down Expand Up @@ -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 || '')
Expand Down

0 comments on commit 5797103

Please sign in to comment.