react-trello
react-trello copied to clipboard
Event 'ADD_CARD' does not work with index: 0 and any other value for index
When I saw the source code for AppendCardToLane, it clears expects a parameter called index
. But, When I tried to pass this parameter with the event ADD_CARD
, the recent created card keeps on the last index of lane.
I'm trying to pass the index
parameter this way:
eventBus.publish({
type: 'ADD_CARD',
laneId: String(response.id_stage),
card: {
id: response.idcustomer,
title: response.name,
description: formatPhone(response.phonenumber || '-'),
laneId: String(response.id_stage),
},
index: 0,
});
To Reproduce Steps to reproduce the behavior:
- Use event.publish with type
ADD_CARD
. - Try to add a card with
index: 0
- You'll see the card at last index of lane.
Expected behavior I expect that passing this parameter to function event.publish will put the card at the first element of lane, not the last.
Hi @bernardimatheus, Ive raised a PR to address this issue.
cc @rcdexta @dapi