add text input into rects

This commit is contained in:
1ilit 2023-09-19 15:47:08 +03:00
parent 99c7407049
commit 91a18e2338

View File

@ -12,14 +12,13 @@ const Rect = (props) => {
style={{ fill: "blue", cursor: "move" }}
onMouseDown={props.onMouseDown}
/>
<text
x={props.x + 50}
y={props.y + 50}
textAnchor="middle"
style={{ fill: "white" }}
>
{props.label}
</text>
<foreignObject x={props.x + 10} y={props.y + 25} width={80} height={50}>
<body xmlns="http://www.w3.org/1999/xhtml">
<form onSubmit={(e) => e.preventDefault()}>
<input type="text" className="w-full" />
</form>
</body>
</foreignObject>
</g>
);
};