-
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 bug with dictation on iOS 18+ #1191
Conversation
karma.conf.js
Outdated
base: "SauceLabs", | ||
browserName: "safari", | ||
platform: "macOS 10.13", | ||
version: "12.1" | ||
version: "16.4" |
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.
@seanpdoyle I got a CI error due to attachInternals
failing in old Safari. I wondered why it passed the other day in your PR. It seems it didn't run the sauce tests there?
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.
That's surprising.
The merge commit failed against main
, but passed (or did not run) on the PR.
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.
CI reads the SAUCE
-prefixed environment variables from GitHub action secrets, sets them as environment variables, then reads those values as part of the Karma setup.
However,
With the exception of GITHUB_TOKEN, secrets are not passed to the runner when a workflow is triggered from a forked repository.
That means unless there is an alternative solution, pull requests from the community won't run in Sauce Labs managed environments. That seems like a risk to the project's backwards compatibility goals.
21f6c67
to
0346be1
Compare
654adcb
to
073e532
Compare
Dictation on iOS does not trigger composition events (https://bugs.webkit.org/show_bug.cgi?id=261764). Instead, it triggers `beforeinput` events with `insertText`. During the dictation phase, it keeps the range anchored to the cursor, and iOS may modify past text as new text adds context. Once dictation is stopped, it starts sending `insertText` events with word fragments. When a past fragment is altered, iOS sends a `beforeinput` event where `inputType` is null. In this case, perform a synchronous render operation to set the editor to the correct state. Otherwise, scheduled render requests can process invalid ranges and mess with the editor contents.
073e532
to
776e1ce
Compare
Fixes a bug where dictating in iOS 18 can result in losing or garbling existing content.
Dictation on iOS does not trigger composition events (https://bugs.webkit.org/show_bug.cgi?id=261764). Instead, it triggers
beforeinput
events withinsertText
. During the dictation phase, it keeps the range anchored to the cursor, and iOS may modify past text as new text adds context.Once dictation is stopped, it starts sending
insertText
events with word fragments. When a past fragment is altered, iOS sends abeforeinput
event whereinputType
is null. In this case, the patch makes Trix perform a synchronous render operation to set the editor to the correct state. Otherwise, scheduled render requests can process invalid ranges and mess with the editor contents.