Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
InsertUser opened this issue Sep 14, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@InsertUser
Copy link

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):

  • OS: Window 11 Home
  • Browsers:
    -- Firefox (version 130.0)
    -- Microsoft Edge (version 128.0.2739.79 (Official build) (64-bit))

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.

@InsertUser InsertUser added the bug Something isn't working label Sep 14, 2024
@MgGriebZ
Copy link

I experience this constantly as well, any chance anyone found a RCA?

@sidharthv96
Copy link
Member

Can you please share a screen recording?
I don't have access to a windows machine. Tested with Firefox, Chrome, Safari and Brave on macOS.

Screen.Recording.2025-04-24.at.11.15.06.AM.mov

@sidharthv96 sidharthv96 added the awaiting response Awaiting response from Creator label Apr 24, 2025
@Mqlvin
Copy link

Mqlvin commented Apr 24, 2025

I am also having this problem, here is a recording of it. Unusually it happened twice or so in the 20 seconds I was recording - this is a bit more frequent than normal.

My cursor gets placed at the start of the editor so my text ends up there - the first time it happened I had stopped typing so I didn't add anything to the top of the box. The second time I finished my word at the top of the box.

2025-04-24.15-14-03.mov

I'm not sure at all of how the live editor works so I don't know if this is useful info, but there are no errors in the console, other than the UnknownDiagramError because I've edited what should've been classDiagram at the top to ructionclassDiagram.

@leandroluk
Copy link

Maybe the editor needs to be maintain the edition content in an runtime store (like zustand) and use a debounce function to update diagram and URL

@sidharthv96
Copy link
Member

@Mqlvin, I was able to reproduce the error, but it's very random, so figuring out the root cause is gonna be tricky.
@leandroluk we're already using stores, and debouncing the URL writes.

@sidharthv96 sidharthv96 removed the awaiting response Awaiting response from Creator label May 1, 2025
@denny-futurice
Copy link

For what it's worth, I've found that this issue gets significantly worse the longer the diagram gets.

I often do not experience the issue, but once a diagram gets to more than 75 lines (maybe entities is a better measure) it starts to happen.

In addition I noticed that it seems that the move of the cursor happens the moment tab completion triggers.

@MgGriebZ
Copy link

For what it's worth, I've found that this issue gets significantly worse the longer the diagram gets.

I often do not experience the issue, but once a diagram gets to more than 75 lines (maybe entities is a better measure) it starts to happen.

In addition I noticed that it seems that the move of the cursor happens the moment tab completion triggers.

I still have it happen with short diagrams, but I think I agree it happens more as the diagram builds larger. I am not sure how to reproduce but what I have suspected is typing too fast somehow conflicts with the autocomplete options.

I am using Edge on work machine (azure virtual machine) and personal PC and experience the same issue in both cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants