connect(drag(ref as HTMLElement))}
- onClick={() => !hasSelectedNode && setProp(props => props.hasSelectedNode = true)}
+ ref={(ref) => { connect(drag(ref as HTMLElement)); }}
+ onClick={() => !hasSelectedNode && setProp((props: any) => props.hasSelectedNode = true)}
style={{ fontSize: `${fontSize}px`, textAlign: textAlign as any }}
className="p-2 hover:outline hover:outline-1 hover:outline-blue-500 relative group"
>
@@ -36,10 +36,13 @@ export const TextSettings = () => {
@@ -49,7 +52,7 @@ export const TextSettings = () => {
@@ -75,7 +78,7 @@ export const Container = ({ background = "#ffffff", padding = 20, children }: {
const { connectors: { connect, drag } } = useNode();
return (
connect(drag(ref as HTMLElement))}
+ ref={(ref) => { connect(drag(ref as HTMLElement)); }}
style={{ background, padding: `${padding}px` }}
className="border border-dashed border-gray-200 min-h-[100px]"
>
@@ -97,16 +100,22 @@ export const ContainerSettings = () => {
setProp(props => props.background = e.target.value)}
+ onChange={(e) => {
+ const val = e.target.value;
+ setProp((props: any) => props.background = val);
+ }}
/>
setProp(props => props.padding = val[0])}
+ onChange={(e) => {
+ const val = Number(e.target.value);
+ setProp((props: any) => props.padding = val);
+ }}
/>