Handle more cases when the drawer should be closed

1. Other item is pressed
2. Any item is long-pressed, including the selected one
3. ChatPage is getting deactivated
This commit is contained in:
Slava Monich 2021-03-27 01:17:49 +02:00
parent 4f65b3b666
commit 9a2b2b0ca8
2 changed files with 7 additions and 1 deletions

View file

@ -55,6 +55,9 @@ ListItem {
if(messageListItem.precalculatedValues.pageIsSelecting) {
page.toggleMessageSelection(myMessage);
} else {
if (messageOptionsDrawer.sourceItem !== messageListItem) {
messageOptionsDrawer.open = false
}
// Allow extra context to react to click
var extraContent = extraContentLoader.item
if (extraContent && extraContentLoader.contains(mapToItem(extraContentLoader, mouse.x, mouse.y))) {
@ -70,6 +73,7 @@ ListItem {
page.selectedMessages = [];
page.state = ""
} else {
messageOptionsDrawer.open = false
contextMenuLoader.active = true;
}
}

View file

@ -449,7 +449,9 @@ Page {
}
}
}
break;
case PageStatus.Deactivating:
messageOptionsDrawer.open = false
break;
case PageStatus.Active:
if (!chatPage.isInitialized) {