mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-18 06:35:35 +08:00
Use key binding for cancelling a message reply
This commit is contained in:
parent
ac7963b509
commit
c84ad9bedc
@ -22,7 +22,7 @@ export enum KeyAction {
|
||||
/** Start editing the user's next sent message */
|
||||
EditNextMessage = 'EditNextMessage',
|
||||
|
||||
/** Cancel editing a message */
|
||||
/** Cancel editing a message or cancel replying to a message */
|
||||
CancelEditing = 'CancelEditing',
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,6 @@ import * as sdk from '../../../index';
|
||||
import Modal from '../../../Modal';
|
||||
import {_t, _td} from '../../../languageHandler';
|
||||
import ContentMessages from '../../../ContentMessages';
|
||||
import {Key} from "../../../Keyboard";
|
||||
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
||||
import RateLimitedFunc from '../../../ratelimitedfunc';
|
||||
import {Action} from "../../../dispatcher/actions";
|
||||
@ -174,13 +173,14 @@ export default class SendMessageComposer extends React.Component {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KeyAction.CancelEditing:
|
||||
dis.dispatch({
|
||||
action: 'reply_to_event',
|
||||
event: null,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
if (event.key === Key.ESCAPE) {
|
||||
dis.dispatch({
|
||||
action: 'reply_to_event',
|
||||
event: null,
|
||||
});
|
||||
} else if (this._prepareToEncrypt) {
|
||||
if (this._prepareToEncrypt) {
|
||||
// This needs to be last!
|
||||
this._prepareToEncrypt();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user