Animation while editing a TextBlock cause weird behavior
ba2sik opened this issue · 9 comments
Hello,
I came across a strange behavior that happens when you edit a text in a TextBlock, and at the same time animate the diagram/node.
The text editing window stays in the previous place, and it looks very strange ...
A reproducible link: https://codepen.io/ba2sik/pen/MWEVrYb
Simply click twice on the node to edit the text, and watch editing winow.
What browser are you using? Can you screenshot what you are seeing?
In Chrome it seems to work OK. The text input stays in the same location while the node moves around, but otherwise I see not change.
Generally I would not recommend moving a node when a user is trying to edit it, but that's not something we would want to enforce at the library level.
I see that too, after editing has begun and after the node has moved. But I think moving the editor with the node would be a mistake to implement. Instead I suggest that any action you create that might move a node will also cease when the TextEditingTool starts. This is difficult to predict from a library standpoint, it is up to individual authors.
In my case, when I select a node, I want the diagram to be centered to the specific node using scrollToPart
.
In addition, I implemented an edit button on a node, that when you click on it, starts editing the text.
The problem is that if the node is not already selected, clicking the edit button also selects the node, which causes the node to be centered with animation, and it leaves the editor in the previous place of the node (before the animation started).
Do you have any suggestions as to what I should do?
Thank you!
Either:
- do not select the node, or
- only start editing after the animation is done, or
- stop any animation before starting editing
For any non-bug questions, please continue via the forum.
For v2.2, upon activation the TextEditingTool now stops any default animation. Thanks for the implicit suggestion.
Thank you very much!
Fixing it by moving the text editor along with the node won't be a better solution?
That would be very disconcerting to most users.