ChatKit
ChatKit copied to clipboard
When updating a selected message in will unselect it but no event is triggered
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.
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
}
}