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

Prevents selection after ZWSP character #1552

Merged
merged 4 commits into from Nov 8, 2019
Merged

Conversation

@koke
Copy link
Member

koke commented Nov 6, 2019

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:

  • Insert a media-text block and tap on the empty paragraph
  • On a blank new post, tap on the placeholder, then tap again
  • On a blank new post, dismiss the keyboard, then tap on the post title

Update release notes:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.
koke added 2 commits Nov 6, 2019
@koke koke added the Writing Flow label Nov 6, 2019
@koke koke added this to the 1.17 milestone Nov 6, 2019
@koke koke requested a review from SergioEstevao Nov 6, 2019
@koke koke mentioned this pull request Nov 7, 2019
5 of 5 tasks complete
// MARK: - Selection
private func correctSelectionAfterZWSP() {
guard selectedTextRange?.start == endOfDocument,
text == String(.zeroWidthSpace) else {

This comment has been minimized.

Copy link
@SergioEstevao

SergioEstevao Nov 7, 2019

Contributor

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?

This comment has been minimized.

Copy link
@koke

koke Nov 8, 2019

Author Member

Good catch, pushed a change to make it more generic

@koke koke requested a review from SergioEstevao Nov 8, 2019
Copy link
Contributor

SergioEstevao left a comment

Thanks for this!

@koke koke merged commit 3bd133a into develop Nov 8, 2019
5 checks passed
5 checks passed
ci/circleci: Check Correctness Your tests passed on CircleCI!
Details
ci/circleci: Test Android Your tests passed on CircleCI!
Details
ci/circleci: Test Android on Device Your tests passed on CircleCI!
Details
ci/circleci: Test iOS Your tests passed on CircleCI!
Details
ci/circleci: Test iOS on Device Your tests passed on CircleCI!
Details
@koke koke deleted the fix/1530-lowercase-keyboard branch Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.