Questions on using TextBlock

Hi GoJS,

I am currently using TextBlock. I realize it is using HTML textarea by default, right?

  1. How can I remove the right-bottom corner on it? For a HTML textarea, I can do resize: none on its style. For sure, I can add this to my css but it will then impact all textarea elements.

  2. How could I put a placeholder text in the editing area?

  3. If disable resizing on textarea, how could I see the text shift to left when the length of text is greater than editable area?

Thanks,
Chuan

You’re actually asking about the TextEditingTool. Simon knows the most about this, so he will answer soon.

The TextArea is always going to be a child of the Diagram DIV, so you can make your CSS rules specific enough to only affect that one:

#myDiagramDiv textarea {
  resize: none;
}

How could I put a placeholder text in the editing area?

Try:

myDiagram.toolManager.textEditingTool.currentTextEditor.placeholder = "placeholder text";

If disable resizing on textarea, how could I see the text shift to left when the length of text is greater than editable area?

What do you mean, “see the text shift to left”?

Thanks Simon. That’s really what I want to know. Ignore the last question. I ask something wrong actually.