"TextEdited" DiagramEvent issue

Hi everybody,

I met a issue when I am using GoJS 1.7.1. I was trying to get the old and new text after text edited action is done on a TextBlock. My event listener is below:

diagram.addDiagramListener(‘TextEdited’, (e) => {
console.log(e.parameter);
console.log(e.subject.text);
setTimeout( () => { console.log(e.subject.text); }, 100);
});

The result I got for this is :
line1: 0.9.0
line2: ‘’
line3: 1.0.0

As you can see, I expected I can get the new text information in line 2.
However, it only displayed the value in line 3 after 100 milliseconds timeout delay.

Is there some internal callback function on this event? Could anybody please help me fix the GoJS issue?

Thanks and best regards,
Mark

I’m unable to reproduce the behavior that you are reporting.

I just copy-pasted your code into the Basic sample. After editing the “Beta” text, I got this output:

Beta
123
123

@walter Thank you so much for quick reply!

On default text editor, you are right.

I forgot to mention that What I am using is “Customized Text Editor”

I am following the demo in https://gojs.net/latest/extensions/TextEditorRadioButtons.js .

Could you please also try this text editor?

Best regards,
Mark

I just tried the same listener in samples/customTextEditingTool. It worked as expected there too, when using extensions/TextEditorRadioButtons.

@walter Thanks a lot for your help! I figure out that’s caused by other issue. It has been fixed.

Best regards,
Mark