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

Update onSplit method on RN blocks to the latest version. #15762

Merged
merged 3 commits into from
May 22, 2019

Conversation

SergioEstevao
Copy link
Contributor

Description

This commit updates the native richtext component to use the latest version of onSplit.
It also updates the custom paragraph and heading blocks to use the new onSplit.

How has this been tested?

Use this PR on GB mobile to test: wordpress-mobile/gutenberg-mobile#1013

Screenshots

Types of changes

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.

This commit updates the native richtext component to use the latest version of onSplit.
It also updates the custom paragraph and heading blocks to use the new onSplit.
@SergioEstevao SergioEstevao added the Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) label May 21, 2019
@SergioEstevao SergioEstevao added this to the 5.8 (Gutenberg) milestone May 21, 2019
@SergioEstevao SergioEstevao requested a review from Tug May 21, 2019 21:09
@Tug
Copy link
Contributor

Tug commented May 22, 2019

Code looks 👍

Testing on both android on ios (demo app)...

@Tug
Copy link
Contributor

Tug commented May 22, 2019

Discovered a bug when merging blocks. I don't think it's related to this PR but I'd like to investigate a bit more.

Here is how to reproduce (on android):

  • Load the demo app with the default initial html
  • Scroll to the heading block "What is gutenberg"
  • Select "bold" and write a few letters in that format
  • Select the block just after this one, setting the cursor in position 0
  • Hit backspace to merge the 2 blocks
  • Notice the blocks are merged
  • Hit Enter to split the blocks
  • Notice the new block is empty

This seems to be happening because onMerge is not triggering a text update (through this.props.value) in the first block in some conditions.

…etween componentWillReceiveProps and componentDidUpdate
@Tug
Copy link
Contributor

Tug commented May 22, 2019

Pushed a fix for the (seemingly unrelated) bug, feel free to test on your end.

Copy link
Contributor

@Tug Tug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚢

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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants