feat: introduce style and behavior improvements

This commit is contained in:
kasia.oczkowska
2024-05-24 11:48:57 +01:00
committed by Ali BARIN
parent 737eb31776
commit f08dc25711
13 changed files with 116 additions and 53 deletions

View File

@@ -0,0 +1,13 @@
import { useEffect } from 'react';
import { useViewport, useReactFlow } from 'reactflow';
export const useScrollBoundries = () => {
const { setViewport } = useReactFlow();
const { x, y, zoom } = useViewport();
useEffect(() => {
if (y > 0) {
setViewport({ x, y: 0, zoom });
}
}, [y]);
};