mermaid-js / mermaid-live-editor

Edit, preview and share mermaid charts/diagrams. New implementation of the live editor.
https://mermaid.live
MIT License
4.3k stars 654 forks source link

Text editor keeps changing input to start of first line for no apparent reason #1537

Open InsertUser opened 2 months ago

InsertUser commented 2 months ago

Describe the bug When typing a description for a node the input swill suddenly switch to the start of the first line in the window. This causes the editor to have a fit because it doesn't recognise the chart type. Needless to say this is incredibly annoying.

To Reproduce Link to Live Editor: a link with nonsense in it (note that the text field starts with "jk" the next two nonsense characters I was typing on line 4) Steps to reproduce the behavior:

  1. Create a new flowchart
  2. Start typing new nodes and descriptions.
  3. At some point in typing out a chart the input will jump to the wrong place and text input will continue there.

I can't be more specific as it just seems to happen for no reason.

Expected behavior I expect text input ton continue in the place I was typing half a second ago not in a completely new location.

Desktop (please complete the following information):

Additional context At first I thought this was related to the appearance an disappearance of errors for part completed connections with text |on the arrow| but I have since seen this on other occasions. It is bad enough that I think it is best to edit in a text editor and copy the text across when a line is complete.