From 9fc71fc4bc2f52de68e92ac9076f78cd4a8fd6a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Magalh=C3=A3es?= Date: Sun, 14 May 2023 23:19:32 -0300 Subject: [PATCH] docs: update dialog example --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4134418..6a83a76 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,8 @@ const CommandMenu = () => { // Toggle the menu when ⌘K is pressed React.useEffect(() => { const down = (e) => { - if (e.key === 'k' && e.metaKey) { + if (e.key === 'k' && (e.metaKey || e.ctrlKey)) { + e.preventDefault() setOpen((open) => !open) } }