FIX: show only context menu on img long press (#22589)

Prior to this commit a long press on the image of a chat message would trigger both the actions menu and the contextual menu. This commit ensures we only show the contextual menu in this case.

No test as it's a quite complex behavior to reproduce (would need android for example).
This commit is contained in:
Joffrey JAFFEUX 2023-07-13 13:31:53 +02:00 committed by GitHub
parent a87841067b
commit d7b7ca82f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -281,11 +281,15 @@ export default class ChatMessage extends Component {
}
@action
onLongPressStart() {
onLongPressStart(element, event) {
if (!this.args.message.expanded) {
return;
}
if (event.target.tagName === "IMG") {
return;
}
// prevents message to show as active when starting scroll
// at this moment scroll has no momentum and the row can
// capture the touch event instead of a scroll
@ -312,7 +316,11 @@ export default class ChatMessage extends Component {
}
@action
onLongPressEnd() {
onLongPressEnd(element, event) {
if (event.target.tagName === "IMG") {
return;
}
cancel(this._makeMessageActiveHandler);
this.isActive = false;