We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7319160 commit 2b1ddd7Copy full SHA for 2b1ddd7
web/components/Window.tsx
@@ -1,13 +1,16 @@
1
import Draggable from "react-draggable";
2
+import { useRef } from "react";
3
4
export function Window({
5
children,
6
className,
7
...props
8
}: { children: React.ReactNode } & React.HTMLAttributes<HTMLDivElement>) {
9
+ const nodeRef = useRef<HTMLDivElement>(null);
10
+
11
return (
- <Draggable handle=".title-bar">
- <div {...props} className={`window ${className || ""}`}>
12
+ <Draggable handle=".title-bar" nodeRef={nodeRef}>
13
+ <div ref={nodeRef} {...props} className={`window ${className || ""}`}>
14
{children}
15
</div>
16
</Draggable>
0 commit comments