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

Commit

Permalink
Only trap escape key for cancel reply if there is a reply (#11140)
Browse files Browse the repository at this point in the history
fall through (to clear read marker) otherwise

Co-authored-by: Richard van der Hoff <[email protected]>
  • Loading branch information
t3chguy and richvdh authored Jun 28, 2023
1 parent d404e06 commit 3ac9066
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/components/views/rooms/SendMessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,15 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
}
break;
case KeyBindingAction.CancelReplyOrEdit:
dis.dispatch({
action: "reply_to_event",
event: null,
context: this.context.timelineRenderingType,
});
event.preventDefault();
event.stopPropagation();
if (!!this.context.replyToEvent) {
dis.dispatch({
action: "reply_to_event",
event: null,
context: this.context.timelineRenderingType,
});
event.preventDefault();
event.stopPropagation();
}
break;
}
};
Expand Down

0 comments on commit 3ac9066

Please sign in to comment.