bugfix: utils file

This commit is contained in:
Braks
2021-07-09 20:00:39 +02:00
parent c4917e2359
commit e400b48e9c
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -20,8 +20,8 @@
"build": "vue-tsc --noEmit && vite build", "build": "vue-tsc --noEmit && vite build",
"build:dist": "rollup -c --environment NODE_ENV:production && postcss src/*.css --dir dist", "build:dist": "rollup -c --environment NODE_ENV:production && postcss src/*.css --dir dist",
"serve": "vite preview", "serve": "vite preview",
"prepublishOnly": "yarn lint && yarn build:dist", "prepublishOnly": "yarn build:dist",
"test": "exit 0", "test": "exit 0;",
"lint:js": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path .gitignore .", "lint:js": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path .gitignore .",
"lint": "yarn lint:js" "lint": "yarn lint:js"
}, },
+1 -1
View File
@@ -3,7 +3,7 @@ import { Dimensions, XYPosition, NodeExtent } from '../types';
export const isInputDOMNode = (e: MouseEvent | /* DraggableEvent | */ KeyboardEvent): boolean => { export const isInputDOMNode = (e: MouseEvent | /* DraggableEvent | */ KeyboardEvent): boolean => {
const target = e.target as HTMLElement; const target = e.target as HTMLElement;
return ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(target?.nodeName) || target.hasAttribute('contenteditable'); return ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(target.nodeName) || target.hasAttribute('contenteditable');
}; };
export const getDimensions = (node: HTMLDivElement): Dimensions => ({ export const getDimensions = (node: HTMLDivElement): Dimensions => ({