-
Notifications
You must be signed in to change notification settings - Fork 56
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
Prevents selection after ZWSP character #1552
Conversation
// MARK: - Selection | ||
private func correctSelectionAfterZWSP() { | ||
guard selectedTextRange?.start == endOfDocument, | ||
text == String(.zeroWidthSpace) else { |
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.
Do you think we could associate the check with this configuration in common init: https://github.com/wordpress-mobile/gutenberg-mobile/pull/1552/files#diff-ad68d1bf3bf68556db4be6e6215573adL136
Just in case the character changes in the future?
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.
Good catch, pushed a change to make it more generic
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.
Thanks for this!
The original issue was that when tapping on an empty RichText, the selection was going to the end of the text by default. As we use the ZWSP character as a placeholder, the selection was after that character, and the keyboard appeared in lowercase mode.
I have a fix that corrects this, but I'm not 100% sure if this is the best place to fix it.
Fixes #1530
To test:
Some scenarios to reproduce the issue:
Update release notes:
RELEASE-NOTES.txt
.