Merged
Conversation
It will be added via the RN wrapper in the react-native-aztec project.
daniloercoli
approved these changes
May 2, 2019
Contributor
Author
|
Chatted over Slack and agreed to merge this now. |
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.
Fix
This PR changes the "Enter" character detection and the messages sent to the React Native side logic. This description will get expanded, WIP.
Background of changes
onEnterKeycallback now delivers the text that the Aztec processor (TextWatcher) was holding when the "Enter" key was detected, thefiredAfterTextChangedflag that shows whether the key has been detected before or after the text has been changed andselStart,selEndfor the position of the caret in that text.toHtml,toPlainHtml) that accept a param with the text that they should work on.Azteclog.logSpansDetails()so it can be used by the AndroidStudio debugger.EnterPressedWatcherand moved it to the react-native-aztec project so we can supply it with props set via the RN layer.text.replace(start, start + 1, "")line that was deleting the "Enter" key when it got detected.Instead, the new assumption is that the key will stay in the text and the client listening (gutenberg-mobile for instance) should try to update its internal representation to match Aztec's behavior.The new assumption is that the deletion will happen conditionally: it won't for the List Gutenberg block and it will for the Paragraph Gutenberg block. Governed by a prop (see point No4).Test
Follow test plans on wordpress-mobile/gutenberg-mobile#928