ChatKit icon indicating copy to clipboard operation
ChatKit copied to clipboard

When updating a selected message in will unselect it but no event is triggered

Open RUSSCITY opened this issue 5 years ago • 1 comments

I'm handling selection mode with my toggleSelectedSection function. When I select prior a message which will be then updated via adapter.update, then adapter unselect this message, but doesn't trigger this event:

adapter.enableSelectionMode { selectedNr ->
                toggleSelectedSection(selectedNr)
}

How can this be fixed? I want to hide my "selection panel" when no message is selected.

RUSSCITY avatar May 04 '20 11:05 RUSSCITY

As a hotfix whenever I want to update or delete a message, I simply run over all selected messages and check message to be updated is selected, in such case I do unselectAllItems.

for (oldMessage in adapter.selectedMessages) {
                if (oldMessage.id == message.id) {
                    adapter.unselectAllItems()
                    break
                }
}

RUSSCITY avatar May 04 '20 12:05 RUSSCITY