Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
Fix undo/redo when input is focused (#888)
Bogdan Chadkinb99d4bb308b1
diff --git a/apps/designer/app/canvas/shared/use-shortcuts.ts b/apps/designer/app/canvas/shared/use-shortcuts.tsindex 9753fdaf18..4d31b51b98 100644--- a/apps/designer/app/canvas/shared/use-shortcuts.ts+++ b/apps/designer/app/canvas/shared/use-shortcuts.ts@@ -23,8 +23,6 @@ declare module "~/shared/pubsub" {}}-const inputTags = ["INPUT", "SELECT", "TEXTAREA"] as const;-type HandlerEvent = {key?: string;preventDefault?: () => void;@@ -94,12 +92,9 @@ export const useShortcuts = () => {esc: publishCancelCurrentDrag,} as const;- useHotkeys(- "backspace, delete",+ useHotkeys("backspace, delete", shortcutHandlerMap.delete, options, [shortcutHandlerMap.delete,- { ...options, enableOnTags: [...inputTags] },- [shortcutHandlerMap.delete]- );+ ]);useHotkeys("esc",@@ -115,7 +110,7 @@ export const useShortcuts = () => {}selectedInstanceIdStore.set(undefined);},- { ...options, enableOnContentEditable: true, enableOnTags: [...inputTags] },+ { ...options, enableOnContentEditable: true },[editingInstanceId]);diff --git a/apps/designer/app/shared/shortcuts/shortcuts.ts b/apps/designer/app/shared/shortcuts/shortcuts.tsindex 860701ee72..93a88c49a4 100644--- a/apps/designer/app/shared/shortcuts/shortcuts.ts+++ b/apps/designer/app/shared/shortcuts/shortcuts.ts@@ -1,3 +1,5 @@+import type { Options } from "react-hotkeys-hook";+export const shortcuts = {esc: "esc",undo: "cmd+z, ctrl+z",@@ -11,4 +13,8 @@ export const shortcuts = {zoom: "=, -",} as const;-export const options = { splitKey: "+", keydown: true };+export const options: Options = {+ splitKey: "+",+ keydown: true,+ enableOnTags: ["INPUT", "SELECT", "TEXTAREA"],+};