refactor(node): dont select when button inside node is clicked

This commit is contained in:
moklick
2019-10-23 20:52:41 +02:00
parent aa1ef79835
commit 70ab31b993
3 changed files with 4 additions and 8 deletions

View File

@@ -8144,7 +8144,7 @@ Grid.displayName = 'Grid';
var isInputDOMNode = function (e) {
var target = e.target;
return (e && target && ['INPUT', 'SELECT', 'TEXTAREA'].includes(target.nodeName));
return e && target && ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(target.nodeName);
};
var getDimensions = function (node) { return ({
width: node.offsetWidth,

2
dist/ReactFlow.js vendored
View File

@@ -8151,7 +8151,7 @@ Grid.displayName = 'Grid';
var isInputDOMNode = function (e) {
var target = e.target;
return (e && target && ['INPUT', 'SELECT', 'TEXTAREA'].includes(target.nodeName));
return e && target && ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(target.nodeName);
};
var getDimensions = function (node) { return ({
width: node.offsetWidth,

View File

@@ -1,13 +1,9 @@
import { DraggableEvent } from 'react-draggable';
import { MouseEvent as ReactMouseEvent } from 'react';
export const isInputDOMNode = (
e: ReactMouseEvent | DraggableEvent | KeyboardEvent
) => {
export const isInputDOMNode = (e: ReactMouseEvent | DraggableEvent | KeyboardEvent) => {
const target = e.target as HTMLElement;
return (
e && target && ['INPUT', 'SELECT', 'TEXTAREA'].includes(target.nodeName)
);
return e && target && ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(target.nodeName);
};
export const getDimensions = (node: HTMLDivElement) => ({