How node size adapts to content

The node is set with width and height or size, and can be resized to adjust the size of the node. Is it also possible to automatically resize the node with the text content of the node input?
Can you give me a small demo if possible?
Also, is it possible to disable resizing of the input box?
Thanks in advance
微信截图_20220222182535

You could use a TextBlock.textEdited event handler that sets the width to NaN, of the sized object – i.e. whichever GraphObject has a Binding on the “width” or “desiredSize”.

The extensions/TextEditor.js or extensionsJSM/TextEditor.ts files show how the built-in text editor is implemented. Note how when there is an input event it measures the text and sets the style.width. You might want to reimplement the text editor in your app after removing that statement. Read more about text editors at: GoJS HTML Interaction -- Northwoods Software

A post was split to a new topic: Customizing ResizingTool’s minSize

The ResizingTool is unrelated to the TextEditingTool, so I moved that question to its own topic.