Skip to content
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(ios): cross-paragraph keyboard rules #10905

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -389,7 +389,7 @@ open class InputViewController: UIInputViewController, KeymanWebDelegate {
textDocumentProxy.deleteBackward()
let newContext = textDocumentProxy.documentContextBeforeInput ?? ""
let unitsDeleted = oldContext.utf16.count - newContext.utf16.count
let unitsInPoint = InputViewController.isSurrogate(oldContext.utf16.last!) ? 2 : 1
let unitsInPoint = InputViewController.isSurrogate(oldContext.utf16.last ?? 0) ? 2 : 1

// This CAN happen when a surrogate pair is deleted.
// For example, the emoji 👍🏻 is made of TWO surrogate pairs.
@@ -416,7 +416,6 @@ open class InputViewController: UIInputViewController, KeymanWebDelegate {
os_log("Failed to swallow a recent textDidChange call!", log: KeymanEngineLogger.ui, type: .default)
}
self.swallowBackspaceTextChange = true
break
}
}