fix build error
This commit is contained in:
@@ -1,9 +1,15 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import Konva from "konva";
|
|
||||||
import { useEditorStore } from "../../store/editorStore";
|
import { useEditorStore } from "../../store/editorStore";
|
||||||
|
|
||||||
export const useKeyboardMovement = () => {
|
export const useKeyboardMovement = () => {
|
||||||
const { selectedObjectId, objects, updateObject, deleteObject, tool, layerRef } = useEditorStore();
|
const {
|
||||||
|
selectedObjectId,
|
||||||
|
objects,
|
||||||
|
updateObject,
|
||||||
|
deleteObject,
|
||||||
|
tool,
|
||||||
|
layerRef,
|
||||||
|
} = useEditorStore();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (tool !== "select") {
|
if (tool !== "select") {
|
||||||
@@ -12,7 +18,11 @@ export const useKeyboardMovement = () => {
|
|||||||
|
|
||||||
const handleKeyDown = (e: KeyboardEvent) => {
|
const handleKeyDown = (e: KeyboardEvent) => {
|
||||||
const target = e.target as HTMLElement;
|
const target = e.target as HTMLElement;
|
||||||
if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable) {
|
if (
|
||||||
|
target.tagName === "INPUT" ||
|
||||||
|
target.tagName === "TEXTAREA" ||
|
||||||
|
target.isContentEditable
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,4 +89,3 @@ export const useKeyboardMovement = () => {
|
|||||||
};
|
};
|
||||||
}, [selectedObjectId, objects, updateObject, deleteObject, tool, layerRef]);
|
}, [selectedObjectId, objects, updateObject, deleteObject, tool, layerRef]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user