feat(nodes): pass pos to click handler
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import React, { createContext, useState, useEffect, useReducer } from 'react';
|
import React, { createContext, useEffect, useReducer } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import isEqual from 'lodash.isequal';
|
import isEqual from 'lodash.isequal';
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export default NodeComponent => (props) => {
|
|||||||
className="react-graph__nodewrap"
|
className="react-graph__nodewrap"
|
||||||
ref={nodeElement}
|
ref={nodeElement}
|
||||||
style={{ transform: `translate(${position.x}px,${position.y}px)` }}
|
style={{ transform: `translate(${position.x}px,${position.y}px)` }}
|
||||||
onClick={() => onNodeClick(data)}
|
onClick={() => onNodeClick({ data, position })}
|
||||||
>
|
>
|
||||||
<NodeComponent {...props} />
|
<NodeComponent {...props} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user