-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix: duplicated newlines when using dictation on iOS 18+. #1196
Conversation
237205b
to
b3390da
Compare
effdb1b
to
29212fd
Compare
08fd174
to
cd64200
Compare
cd64200
to
f98e336
Compare
This fixes a bug that started to happen with iOS 18, where you would get duplicated newlines after completing the dictation. The bug happens because, upon dictation completion, iOS sends the sequence of `beforeinput` events very quickly. With the `insertParagraph` ones, it can happen that the internal document range fails to update, resulting in duplicated newlines and missed content. This workaround is necessary due to the inability to distinguish text entered in dictation mode, as iOS WebKit doesn’t trigger composition events during dictation (https://bugs.webkit.org/show_bug.cgi?id=261764).
f98e336
to
c681258
Compare
|
||
if (handler) { | ||
this.withEvent(event, handler) | ||
this.scheduleRender() | ||
|
||
if (!immmediateRender) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm conservatively applying the patch to only iOS and only in certain scenarios. It would be simpler to just render things synchronously all the times. We should probably just always render synchronously if more of these show up. Scheduled rendering waits for an animation frame to render, which is good to avoid locking screen rendering, but it's problematic when receiving many events in a very quick sequence.
This updates Trix to 2.1.8, which includes a patch for a dictation issue in iOS 18+ where it garbles newlines when dictation ends. See basecamp/trix#1196
This updates Trix to 2.1.8, which includes a patch for a dictation issue in iOS 18+ where it garbles newlines when dictation ends. See basecamp/trix#1196
Fix: duplicated newlines when using dictation on iOS 18+.
This fixes a bug that started to happen with iOS 18, where you would get duplicated newlines
after completing the dictation.
The bug happens because, upon dictation completion, iOS sends the sequence of
beforeinput
eventsvery quickly. With the
insertParagraph
ones, it can happen that the internal document range failsto update, resulting in duplicated newlines and missed content.
This workaround is necessary due to the inability to distinguish text entered in dictation mode, as
iOS WebKit doesn’t trigger composition events during dictation (https://bugs.webkit.org/show_bug.cgi?id=261764).