Add cancel edit-message on Escape Key press (#765)
This commit is contained in:
1 parent
6f7934badc
commit
1deef51df0
1 file changed
+5
@@ -290,6 +290,11 @@ function MessageEdit({ body, onSave, onCancel }) {
|
||||
}, []);
|
||||
|
||||
const handleKeyDown = (e) => {
|
||||
if (e.key === 'Escape') {
|
||||
e.preventDefault();
|
||||
onCancel();
|
||||
}
|
||||
|
||||
if (e.key === 'Enter' && e.shiftKey === false) {
|
||||
e.preventDefault();
|
||||
onSave(editInputRef.current.value);
|
||||
|
||||
Reference in new issue
Block a user