fix: zoom pan helper
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { ElementId, RevueFlowStore, UpdateNodeInternals } from '../types'
|
||||
|
||||
function useUpdateNodeInternals(): UpdateNodeInternals {
|
||||
const store = inject<RevueFlowStore>('store')!
|
||||
|
||||
return (id: ElementId) => {
|
||||
const nodeElement: HTMLDivElement | null = document.querySelector(`.revue-flow__node[data-id="${id}"]`)
|
||||
|
||||
if (nodeElement) {
|
||||
store.updateNodeDimensions([{ id, nodeElement, forceUpdate: true }])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default useUpdateNodeInternals
|
||||
Reference in New Issue
Block a user