Skip to content

fix(editor): Prevent race condition and ensure correct list continuation on Enter #4716

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonfk
Copy link

@jonfk jonfk commented May 23, 2025

ScreenRecording_05-22-2025.21-25-45_1.mp4

I am not always able to reproduce it. But this often happens on iOS Safari on my iPhone 13 Pro and iPad Pro M2.

From what I can tell, it seems there is a race condition between the default behaviour of the event handler and the insertText to be inserted. It only seems to happen with the task list continuation, maybe because it is slightly longer than the other list continuations.

This fix removes the race condition and inserts the newline manually before the insertText.
After implementing this fix, I don't see this occurring on my devices anymore.

Thanks for considering the fix.

@jonfk jonfk requested a review from boojack as a code owner May 23, 2025 01:42
@jonfk jonfk force-pushed the bugfix-md-list-race-condition branch from c75b52b to 8041706 Compare May 23, 2025 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant