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

View File

@@ -20,8 +20,8 @@
"build": "vue-tsc --noEmit && vite build",
"build:dist": "rollup -c --environment NODE_ENV:production && postcss src/*.css --dir dist",
"serve": "vite preview",
"prepublishOnly": "yarn lint && yarn build:dist",
"test": "exit 0",
"prepublishOnly": "yarn build:dist",
"test": "exit 0;",
"lint:js": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path .gitignore .",
"lint": "yarn lint:js"
},

View File

@@ -3,7 +3,7 @@ import { Dimensions, XYPosition, NodeExtent } from '../types';
export const isInputDOMNode = (e: MouseEvent | /* DraggableEvent | */ KeyboardEvent): boolean => {
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 => ({