Skip to content

Conversation

@koke
Copy link
Contributor

@koke koke commented Dec 19, 2019

Description

Aztec can send us selection change events after it has lost focus.

For instance the autocorrect feature will complete a partially written word when resigning focus, causing a selection change event. Forwarding this selection change could cause this RichText to regain focus and start a focus loop.

This PR prevents that selection forwarding when the RichText component isn't already selected.

I'm not sure what other side effects this could have, so pinging several people on this one 😬

Fixes: wordpress-mobile/gutenberg-mobile#1696

How has this been tested?

gutenberg-mobile PR: wordpress-mobile/gutenberg-mobile#1698

Tested with the steps in wordpress-mobile/gutenberg-mobile#1696:

  1. Have a media-text block
  2. Start typing some text in the paragraph until iOS suggest a completion
  3. Tap on the image

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .

@koke koke added Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Package] Rich text /packages/rich-text labels Dec 19, 2019
@dratwas dratwas mentioned this pull request Dec 20, 2019
6 tasks
@etoledom
Copy link
Contributor

@koke - Should we close this? It seems to be already fixed wordpress-mobile/gutenberg-mobile#1698 (comment)

@koke
Copy link
Contributor Author

koke commented Feb 17, 2020

Ah yes, thanks, I missed this one

@koke koke closed this Feb 17, 2020
@aristath aristath deleted the fix/rich-text-autocomplete-focus-loop branch November 10, 2020 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Package] Rich text /packages/rich-text

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Focus loop on Rich Text

3 participants