Hi, I'd like to create a more wysiwyg text edit experience
Here is a video with an example of the kind of thing I am trying to achieve...
I can do it using an HTML node and javascript, but I'd like to get it working for standard nodes/shapes if it is at all possible...
Many thanks!
Geoff
|
Is it possible to trigger text edit this without double clicking but on a keypress event? |
When you click on a node, node click event gets triggered. In that event you can able to start edit the text using startTextEdit method without double click on node. Please refer to the below code snippet and sample
| |
|
Is it possible to make the annotation edit boy the same size as the shape and transparent? |
By default in the diagram, the text edit box gets rendered based on the text bounds. We cannot able to make the text edit box as same size as shape. |
Thanks very much Aravind.
Is it possible to not use the default text edit box and implement our own?
Regards, Geoff
Hi Geoff,
We have rendered the
default textbox internally in our source and it is not possible to implement
your own textbox by overriding it but you can customize it. We have created a
sample to customize the textbox.
Code snippet:
|
public click(args: IClickEventArgs) { if (args.element instanceof Node) { this.diagram.startTextEdit(args.element); let textArea: HTMLTextAreaElement = document.getElementById(this.diagram.element.id + '_editBox') as HTMLTextAreaElement; textArea.style.border = '2px solid red'; textArea.style.borderRadius = '25px'; } } |
Sample: https://stackblitz.com/edit/angular-sgxkk2-p6j24q?file=app.component.ts
Regards
Arun Kumar.