feat(onElementClick): always allow onElementClick to run

This commit is contained in:
Nate Amack
2020-08-18 10:59:22 -06:00
parent 81eb7fa695
commit 34473166cb
3 changed files with 9 additions and 11 deletions
+3 -5
View File
@@ -53,15 +53,13 @@ export default (EdgeComponent: ComponentType<EdgeCompProps>) => {
const edgeClasses = cc(['react-flow__edge', `react-flow__edge-${type}`, className, { selected, animated }]);
const edgeGroupStyle: CSSProperties = {
pointerEvents: elementsSelectable ? 'all' : 'none',
pointerEvents: elementsSelectable || onClick ? 'all' : 'none',
};
const onEdgeClick = (event: React.MouseEvent<SVGGElement, MouseEvent>): void => {
if (!elementsSelectable) {
return;
if (elementsSelectable) {
setSelectedElements({ id, source, target });
}
setSelectedElements({ id, source, target });
if (onClick) {
const edgeElement: Edge = { id, source, target, type };