Operating system
Windows
Joplin version
3.0.8
Editor
Rich Text Editor
What issue do you have?
I am a Chinese user. Sometimes, when inputting Chinese and selecting it, the cursor unexpectedly jumps to the first position in the note.
Are there others who have encountered the same problem?
Just like in the picture, when I enter content in other lines, the cursor automatically jumps to the first position in the first line of the note.
I was able to reproduce the issue with the log open. I am uploading the log now.
log-cusor_jump-0711.7z (36.9 KB)
Is this a bug?
The issue seems to persist even after I enable safe mode.
I suspect it is not related to plugins, but I hope a developer can look at the logs.
muzak
15 July 2024 13:53
6
Yes, the Github issue I linked above is for the bug you are facing. If possible, you should repost or link to your above info on that issue.
If you can provide confirmation of this happening in the Rich Text Editor on that issue, this pull request may open back up:
laurent22:dev
← personalizedrefrigerator:pr/desktop/fix-cursor-jump-tinymce-try-2
opened 07:00PM - 10 Jun 24 UTC
# Summary
This pull request tries to fix #8960 (#10449 seems to have failed t… o do so). It does so by marking the current note as changed immediately after a key is pressed (rather than waiting for an `onChange` event to be received).
In particular, this pull request focuses on the Rich Text Editor because it's simpler to implement and I am not certain that this will fix the issue. If it does, a similar change can be made to the beta and legacy markdown editors.
May fix #8960.
# Rationale
Logs [collected before #10449 was merged](https://github.com/laurent22/joplin/issues/8960#issuecomment-2123481861) suggest that #8960 was caused by a race condition where:
1. The user types something.
2. Sync completes. The form note updates and doesn't match the editor's content. The editor isn't marked as changed by the user, so is updated. This moves the cursor to the start of the note.
3. The note is marked as changed by step 1, too late to stop the editor's contents from being replaced by step 2.
#10449 eliminated the need for a React re-render between the editor's `change` event and marking the editor's content as changed (in step 3). If #8960 is still happening because the `change` event isn't firing soon enough after the editor is changed, marking the editor as changed on key down events might fix the issue.
# Testing plan
Regression testing:
1. Create a new note.
5. Type several paragraphs in the Rich Text editor.
6. Switch notes.
7. Switch back to the original note.
8. Verify that changes made to the original were saved.
This has been tested successfully on Ubuntu 24.04.
<!--
Please prefix the title with the platform you are targetting:
Here are some examples of good titles:
- Desktop: Resolves #123: Added new setting to change font
- Mobile, Desktop: Fixes #456: Fixed config screen error
- All: Resolves #777: Made synchronisation faster
And here's an explanation of the title format:
- "Desktop" for the Windows/macOS/Linux app (Electron app)
- "Mobile" for the mobile app (or "Android" / "iOS" if the pull request only applies to one of the mobile platforms)
- "CLI" for the CLI app
If it's two platforms, separate them with commas - "Desktop, Mobile" or if it's for all platforms, prefix with "All".
If it's not related to any platform (such as a translation, change to the documentation, etc.), simply don't add a platform.
Then please append the issue that you've addressed or fixed. Use "Resolves #123" for new features or improvements and "Fixes #123" for bug fixes.
AND PLEASE READ THE GUIDE: https://github.com/laurent22/joplin/blob/dev/readme/dev/index.md
-->
1 Like
If you can provide confirmation of this happening in the Rich Text Editor on that issue
--------> yes, I mostly use the rich text editor
I use markdown editor and have same problem...
I have a theory this situation happens when a sync or disk save happens mid-edit.
This happened to me last week while I was mid typing a note. I think I glanced some activity bottom left, aka a sync.
FWIW, I'm using webdav for sync too.
1 Like
the funny thing is, many people has reported jumping cursor issue, but none of them get fixed.
it mean , I use editor when sync will cause this ?
system
Closed
3 October 2024 03:09
13
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.