Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 3ac9066

Browse files
t3chguyrichvdh
andauthored
Only trap escape key for cancel reply if there is a reply (#11140)
fall through (to clear read marker) otherwise Co-authored-by: Richard van der Hoff <[email protected]>
1 parent d404e06 commit 3ac9066

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/components/views/rooms/SendMessageComposer.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,13 +351,15 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
351351
}
352352
break;
353353
case KeyBindingAction.CancelReplyOrEdit:
354-
dis.dispatch({
355-
action: "reply_to_event",
356-
event: null,
357-
context: this.context.timelineRenderingType,
358-
});
359-
event.preventDefault();
360-
event.stopPropagation();
354+
if (!!this.context.replyToEvent) {
355+
dis.dispatch({
356+
action: "reply_to_event",
357+
event: null,
358+
context: this.context.timelineRenderingType,
359+
});
360+
event.preventDefault();
361+
event.stopPropagation();
362+
}
361363
break;
362364
}
363365
};

0 commit comments

Comments
 (0)