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 problem with iOS beta 8 suggestions #1165

Merged
merged 1 commit into from
Jul 5, 2024
Merged

Conversation

jorgemanrubia
Copy link
Member

iOS beta 8 renders a preview of the suggestion that messes up with text composing in Trix. You may end up with misspelled words when typing in the suggested term. For example:

  1. Type: "kno".
  2. iOS suggests "know".
  3. Type: "w"

The final word is "knww".

The problem is the system that handles compositionend events, which relies on deleting the composed text. When that only has one character, we default to performing a regular delete operation. The problem with the new iOS dimmed suggestions is that this matches the interaction of typing in the last character in a suggestion, and it results in Trix wrongly deleting legit content when discarding the suggestion.

This solution relaxes the condition to rely on the range when there is a length of one when the editor is in composing mode.

@jorgemanrubia jorgemanrubia force-pushed the bug+safari-autocomplete branch 3 times, most recently from 54fedcf to c349489 Compare June 26, 2024 14:57
iOS beta 8 renders a preview of the suggestion that messes up with text composing in Trix. You may end
up with misspelled words when typing in the suggested term. For example:

1. Type: "kno".
2. iOS suggests "know".
3. Type: "w"
4. The final word is "knww".

The problem is the system that handles compositionend events, which relies on deleting the composed text.
When that only has one character, we default to performing a regular delete operation. The problem
 with the new iOS dimmed suggestions is that this matches the interaction of typing in the last character
 in a suggestion, and it results in Trix wrongly deleting legit content when discarding the suggestion.

This solution relaxes the condition to rely on the range when there is a length of one when the editor
is in composing mode.
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