Close/cancel draft "reply to" on Escape (#4387)
This commit is contained in:
parent
c907fd36ba
commit
1503053496
3 changed files with 14 additions and 3 deletions
|
@ -42,6 +42,8 @@ export type Props = {
|
|||
onTextTooLong(): unknown;
|
||||
onPickEmoji(o: EmojiPickDataType): unknown;
|
||||
onSubmit(message: string): unknown;
|
||||
getQuotedMessage(): unknown;
|
||||
clearQuotedMessage(): unknown;
|
||||
};
|
||||
|
||||
export type InputApi = {
|
||||
|
@ -217,6 +219,8 @@ export const CompositionInput = ({
|
|||
onSubmit,
|
||||
skinTone,
|
||||
startingText,
|
||||
getQuotedMessage,
|
||||
clearQuotedMessage,
|
||||
}: Props) => {
|
||||
const [editorRenderState, setEditorRenderState] = React.useState(
|
||||
getInitialEditorState(startingText)
|
||||
|
@ -462,6 +466,8 @@ export const CompositionInput = ({
|
|||
if (emojiResults.length > 0) {
|
||||
e.preventDefault();
|
||||
resetEmojiResults();
|
||||
} else if (getQuotedMessage()) {
|
||||
clearQuotedMessage();
|
||||
}
|
||||
},
|
||||
[resetEmojiResults, emojiResults]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue