Explorar o código

Make tools shortcuts case insensitive (#1532) (#1533)

Esteban %!s(int64=5) %!d(string=hai) anos
pai
achega
7522c48453
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/shapes.tsx

+ 3 - 1
src/shapes.tsx

@@ -83,7 +83,9 @@ export const shapesShortcutKeys = SHAPES.map((shape, index) => [
 export function findShapeByKey(key: string) {
   return (
     SHAPES.find((shape, index) => {
-      return shape.value[0] === key || key === (index + 1).toString();
+      return (
+        shape.value[0] === key.toLowerCase() || key === (index + 1).toString()
+      );
     })?.value || "selection"
   );
 }