diff --git a/components/Blocks.tsx b/components/Blocks.tsx index 42bcd659..b53763ad 100644 --- a/components/Blocks.tsx +++ b/components/Blocks.tsx @@ -207,6 +207,10 @@ function Block(props: BlockProps) { document.getElementById(elementId.block(newEntityID).text)?.focus(); }, 10); } + if (e.key === "Escape") { + e.preventDefault(); + useUIState.setState({ selectedBlock: [] }); + } }; window.addEventListener("keydown", listener); return () => window.removeEventListener("keydown", listener);