We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I have a problem when I zoom on my div, the minimap container does not synchronize, when I zoom out, it works, zoom in does not work.
Voici mon code :
function Home() { const [zoom, setZoom] = React.useState(1); const containerRef = useRef<HTMLDivElement>(null); useEffect(() => { const onWheel = (e: any) => { e.preventDefault(); setZoom((value) => { const newZoom = value + e.deltaY * -0.001; if (newZoom > 0.1 && newZoom < 1) { return newZoom; } else { return value; } }); }; nodeRef.current?.addEventListener("wheel", onWheel); return () => { nodeRef.current?.removeEventListener("wheel", onWheel); }; }, []); const renderChild = ({ width, height, left, top, node }) => { const classNames = ["node-content"]; let classNameFound = null; node.classList.forEach((className) => { if (classNames.includes(className)) { classNameFound = className; return false; } }); if (classNameFound === null) return <ChildComponent {...{ width, height, left, top }} />; return ( <div style={{ position: "absolute", width, height, left, top, backgroundColor: "#" + HEX[classNameFound], }} /> ); }; return ( <div className="App"> <div ref={containerRef} className={clsx("container")}> <Minimap selector=".node-content" childComponent={renderChild}> <div ref={nodeRef} style={{ scale: zoom }} className="flex select-none" > <NodeComponent type="root" node={nodeRoot} /> </div> </Minimap> </div> </div> ); }
export default Home;
If you have the solution to my problem, I'll take it. Thx, have a good one!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
I have a problem when I zoom on my div, the minimap container does not synchronize, when I zoom out, it works, zoom in does not work.
Voici mon code :
export default Home;
If you have the solution to my problem, I'll take it. Thx, have a good one!
The text was updated successfully, but these errors were encountered: