sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.17k stars 216 forks source link

markdown: "Out of control cursor jumps to previous position in the sentence while typing" #6803

Closed williamstein closed 3 months ago

williamstein commented 1 year ago

WHAT DID YOU DO EXACTLY? I was typing a sentence into a markdown cell in a Jupyter notebook using the WYSIWYG Rich Text Slate Editor WHAT HAPPENED? The cursor jumped to a previous position in the sentence without any additional input. I did not press special key combos to navigate the cursor. HOW DID THIS DIFFER FROM WHAT YOU EXPECTED? I expected the cursor to remain at the same position as I was typing.

williamstein commented 1 year ago

I saw this in the whiteboard when editing a note. I then checked the console.log and saw this:

image
williamstein commented 10 months ago

After the upgrade I haven't seen this problem for a while, at least not with chat or tasks. However, I saw this just now in a whiteboard when editing a note with an emumerated list that looks like this:

image

I was typing at the end of the second bullet point, and the cursor jumped to the beginning of the first bullet point. I was using an external keyboard with no mouse.

Weird things:

- suppose you have a directory scratch that is not sync'd, and a file a.txt, and several compute servers.
- When you switch between various compute servers and the project, a.txt switches between them. The history is unified though, which is a bit odd.  But really this is not at all a workflow we 

So the bug remains.

williamstein commented 10 months ago

For what it's worth, I think I've never once seen this issue when editing a .md file, which uses our react-virtuoso windowing functionality. In contrast in task lists and the notebook, the chunks of markdown are short, so windowing is not used. Maybe always enabling windowing would fix the problem. Also, we could set a max height and enable windowing/scrolling in all context, which would make it possible to have very long markdown content anywhere in a notebook or task list without things getting slow.

williamstein commented 3 months ago

I'm reopening this since I think I just saw it when editing a bulleted list in a task list.

williamstein commented 3 months ago

I definitely just hit this in a bulleted list in a task list. Basically I typed at the very end of a list item and the cursor jumps to the beginning. There's a lot of Transform.setSelection calls all over in the code, and maybe there is one that happens periodically in this case.

williamstein commented 3 months ago

I made several more attempts and this might be fixed now. We will see.

williamstein commented 3 months ago

Still not fixed. :-(

williamstein commented 2 months ago

Good news -- I've not seen this and nobody has reported this for a month now!