[Rnmobile] Fix the list handling on Android#15168
Merged
Conversation
And assume that when that flag is false, component changes need to get sent/reflected down to Aztec.
The iOS side still expects to just check against `this.lastContent` to force the change into Aztec.
This reverts commit e22ffde.
Aztec-Android doesn't swallow the Enter key (like the list handling does) so, instruct Aztec to delete it for the paragraph block.
Doing this by reverting onFormatChange's behavior back to assuming doUpdateChild is false by default.
daniloercoli
approved these changes
May 2, 2019
Contributor
There was a problem hiding this comment.
We've had a chat convo about the possibility to get rid of the newly introduced deleteEnter prop, but agreed it's the best solution at the moment.
We will probably need to revise the code once again, when will introduce multi-line paragraph blocks (we will need to handle the enter.key detection again).
Contributor
Author
|
Will merge this PR now and will cherry-pick the merge-commit into our special branch ( |
hypest
added a commit
that referenced
this pull request
May 2, 2019
* If text already changed, don't modify it * Able to not lose content * Use a flag to signal Aztec-originated changes And assume that when that flag is false, component changes need to get sent/reflected down to Aztec. * Differentiate Android and iOS since assumptions diverged The iOS side still expects to just check against `this.lastContent` to force the change into Aztec. * Force Aztec update if "Enter" fired before text change * Need to specify firedAfterTextChanged on all Aztec events * Fix lint issues * chore: Fix: Lint error that makes unit tests (and CI tests) fail. (#15073) * Trivial change to trigger Travis * Revert "Trivial change to trigger Travis" This reverts commit e22ffde. * Just use onFormatChange which now defaults to "force" * Have Aztec delete the detected Enter key for paragraphs Aztec-Android doesn't swallow the Enter key (like the list handling does) so, instruct Aztec to delete it for the paragraph block. * Don't force Aztec update on format button toggles Doing this by reverting onFormatChange's behavior back to assuming doUpdateChild is false by default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Introduces changes to how the the React Native mobile app's RichText handles the events coming from the native side, especially for Android.
How has this been tested?
Using the gutenberg-mobile PR: wordpress-mobile/gutenberg-mobile#928
Types of changes
onFormatChange()to update Aztec. Can (and is) overridden by using thefiredAfterTextChangedflag to avoid updating Aztec if the change has already happened in Aztec.deleteEnteron the paragraph block's RichText component to denote that we want Aztec to delete theEnterkey at the end of the block, otherwise Aztec-Android leaves it there. We don't need to specify it for the list block though because Aztec removes theEnterthere as part of its list handling process.Checklist: