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:
parent
a87841067b
commit
d7b7ca82f5
|
@ -281,11 +281,15 @@ export default class ChatMessage extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
onLongPressStart() {
|
onLongPressStart(element, event) {
|
||||||
if (!this.args.message.expanded) {
|
if (!this.args.message.expanded) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.target.tagName === "IMG") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// prevents message to show as active when starting scroll
|
// prevents message to show as active when starting scroll
|
||||||
// at this moment scroll has no momentum and the row can
|
// at this moment scroll has no momentum and the row can
|
||||||
// capture the touch event instead of a scroll
|
// capture the touch event instead of a scroll
|
||||||
|
@ -312,7 +316,11 @@ export default class ChatMessage extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
onLongPressEnd() {
|
onLongPressEnd(element, event) {
|
||||||
|
if (event.target.tagName === "IMG") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cancel(this._makeMessageActiveHandler);
|
cancel(this._makeMessageActiveHandler);
|
||||||
this.isActive = false;
|
this.isActive = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue