esc to close edit message window

This commit is contained in:
2023-07-27 10:44:53 +08:00
parent 196e12a4fd
commit 120bdddc3b

View File

@@ -111,6 +111,11 @@ export default function Message(props: Props) {
"absolute bg-black bg-opacity-50 w-full h-full top-0 left-0 pt-5 px-5 pb-20 rounded z-10"
}
onClick={() => setShowEdit(false)}
onKeyDown={(e: any) => {
if (e.keyCode === 27) {
setShowEdit(false);
}
}}
>
<div className="w-full h-full z-20">
<textarea