Browse Source

fix: stop replacing `del` word with `Delete` (#5897)

David Luzar 2 years ago
parent
commit
81fd2350a9
3 changed files with 3 additions and 4 deletions
  1. 1 1
      src/actions/shortcuts.ts
  2. 1 1
      src/components/HelpDialog.tsx
  3. 1 2
      src/utils.ts

+ 1 - 1
src/actions/shortcuts.ts

@@ -48,7 +48,7 @@ const shortcutMap: Record<ShortcutName, string[]> = {
   copyStyles: [getShortcutKey("CtrlOrCmd+Alt+C")],
   copyStyles: [getShortcutKey("CtrlOrCmd+Alt+C")],
   pasteStyles: [getShortcutKey("CtrlOrCmd+Alt+V")],
   pasteStyles: [getShortcutKey("CtrlOrCmd+Alt+V")],
   selectAll: [getShortcutKey("CtrlOrCmd+A")],
   selectAll: [getShortcutKey("CtrlOrCmd+A")],
-  deleteSelectedElements: [getShortcutKey("Del")],
+  deleteSelectedElements: [getShortcutKey("Delete")],
   duplicateSelection: [
   duplicateSelection: [
     getShortcutKey("CtrlOrCmd+D"),
     getShortcutKey("CtrlOrCmd+D"),
     getShortcutKey(`Alt+${t("helpDialog.drag")}`),
     getShortcutKey(`Alt+${t("helpDialog.drag")}`),

+ 1 - 1
src/components/HelpDialog.tsx

@@ -303,7 +303,7 @@ export const HelpDialog = ({ onClose }: { onClose?: () => void }) => {
             />
             />
             <Shortcut
             <Shortcut
               label={t("labels.delete")}
               label={t("labels.delete")}
-              shortcuts={[getShortcutKey("Del")]}
+              shortcuts={[getShortcutKey("Delete")]}
             />
             />
             <Shortcut
             <Shortcut
               label={t("labels.sendToBack")}
               label={t("labels.sendToBack")}

+ 1 - 2
src/utils.ts

@@ -326,8 +326,7 @@ export const getShortcutKey = (shortcut: string): string => {
   shortcut = shortcut
   shortcut = shortcut
     .replace(/\bAlt\b/i, "Alt")
     .replace(/\bAlt\b/i, "Alt")
     .replace(/\bShift\b/i, "Shift")
     .replace(/\bShift\b/i, "Shift")
-    .replace(/\b(Enter|Return)\b/i, "Enter")
-    .replace(/\bDel\b/i, "Delete");
+    .replace(/\b(Enter|Return)\b/i, "Enter");
 
 
   if (isDarwin) {
   if (isDarwin) {
     return shortcut
     return shortcut