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