Skip to content

Fix list handling in Gutenberg#812

Merged
hypest merged 16 commits intodevelopfrom
fix/list-handling-in-gutenberg-attempt1
May 2, 2019
Merged

Fix list handling in Gutenberg#812
hypest merged 16 commits intodevelopfrom
fix/list-handling-in-gutenberg-attempt1

Conversation

@hypest
Copy link
Copy Markdown
Contributor

@hypest hypest commented Apr 25, 2019

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

  1. The onEnterKey callback now delivers the text that the Aztec processor (TextWatcher) was holding when the "Enter" key was detected, the firedAfterTextChanged flag that shows whether the key has been detected before or after the text has been changed and selStart, selEnd for the position of the caret in that text.
  2. Introduce new variants of some methods (toHtml, toPlainHtml) that accept a param with the text that they should work on.
  3. Exposed Azteclog.logSpansDetails() so it can be used by the AndroidStudio debugger.
  4. Removed the EnterPressedWatcher and moved it to the react-native-aztec project so we can supply it with props set via the RN layer.
  5. Removed the 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

@hypest hypest added the Gutenberg This issue is also valid importing Aztec in Gutenberg label Apr 25, 2019
@hypest hypest self-assigned this Apr 25, 2019
It will be added via the RN wrapper in the react-native-aztec project.
@hypest
Copy link
Copy Markdown
Contributor Author

hypest commented May 2, 2019

Chatted over Slack and agreed to merge this now.

@hypest hypest merged commit 0a4a1b2 into develop May 2, 2019
@hypest hypest deleted the fix/list-handling-in-gutenberg-attempt1 branch May 2, 2019 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gutenberg This issue is also valid importing Aztec in Gutenberg

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants