@@ -155,7 +155,9 @@ export default function NodeDescription({
maxLength={charLimit}
className={cn(
"nowheel w-full text-xs focus:border-primary focus:ring-0",
- stickyNote ? "p-0 pt-0.5 !text-mmd" : "px-2 py-0.5",
+ stickyNote
+ ? "overflow-auto p-0 px-2 pt-0.5 !text-mmd"
+ : "px-2 py-0.5",
inputClassName,
)}
autoFocus
@@ -168,7 +170,7 @@ export default function NodeDescription({
{charLimit && (nodeDescription?.length ?? 0) >= charLimit - 100 && (
= charLimit
? "text-error"
: "text-primary",
diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx
index d6406ae3b..dae1f3fde 100644
--- a/src/frontend/src/CustomNodes/GenericNode/index.tsx
+++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx
@@ -554,6 +554,7 @@ function GenericNode({
key === data.node?.template.backgroundColor,
) ?? Object.keys(COLOR_OPTIONS)[0];
const nodeDiv = useRef(null);
- const [size, setSize] = useState({
- width: DEFAULT_WIDTH - NOTE_NODE_PADDING,
- height: DEFAULT_HEIGHT - NOTE_NODE_PADDING,
- });
const [resizedNote, setResizedNote] = useState(false);
const currentFlow = useFlowStore((state) => state.currentFlow);
const setNode = useFlowStore((state) => state.setNode);
@@ -47,12 +43,12 @@ function NoteNode({
);
const nodeDataWidth = useMemo(
- () => nodeData?.width ?? DEFAULT_WIDTH,
- [nodeData?.width],
+ () => nodeData?.measured?.width ?? DEFAULT_WIDTH,
+ [nodeData?.measured?.width],
);
const nodeDataHeight = useMemo(
- () => nodeData?.height ?? DEFAULT_HEIGHT,
- [nodeData?.height],
+ () => nodeData?.measured?.height ?? DEFAULT_HEIGHT,
+ [nodeData?.measured?.height],
);
const dataId = useMemo(() => data.id, [data.id]);
@@ -64,10 +60,6 @@ function NoteNode({
const debouncedResize = useMemo(
() =>
debounce((width: number, height: number) => {
- setSize({
- width: width - NOTE_NODE_PADDING,
- height: height - NOTE_NODE_PADDING,
- });
setNode(data.id, (node) => {
return {
...node,
@@ -79,22 +71,6 @@ function NoteNode({
[],
);
- useEffect(() => {
- if (nodeData && !resizedNote && nodeDataWidth > 0 && nodeDataHeight > 0) {
- setSize({
- width: nodeDataWidth - NOTE_NODE_PADDING,
- height: nodeDataHeight - NOTE_NODE_PADDING,
- });
- } else if (!nodeData && nodeDiv.current) {
- const currentWidth = nodeDiv.current.offsetWidth || DEFAULT_WIDTH;
- const currentHeight = nodeDiv.current.offsetHeight || DEFAULT_HEIGHT;
- setSize({
- width: Math.max(currentWidth, DEFAULT_WIDTH) - NOTE_NODE_PADDING,
- height: Math.max(currentHeight, DEFAULT_HEIGHT) - NOTE_NODE_PADDING,
- });
- }
- }, [nodeData, nodeDataWidth, nodeDataHeight, resizedNote]);
-
const [editNameDescription, set] = useAlternate(false);
const MemoNoteToolbarComponent = useMemo(
@@ -108,6 +84,8 @@ function NoteNode({
),
[data, bgColor, selected],
);
+ console.log(nodeData);
+ console.log();
return (
<>
setSearchQuery(e.target.value)}
ref={searchInputRef}
- className="w-3/4 rounded-lg bg-background pl-8 lg:w-2/3"
+ className="w-3/4 rounded-lg bg-background lg:w-2/3"
/>