Skip to content

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

Merged
SergioEstevao merged 3 commits into
masterfrom
rnmobile/on_split_updates
May 22, 2019
Merged

SergioEstevao merged 3 commits into
masterfrom
rnmobile/on_split_updates

Conversation

@SergioEstevao

Copy link
Copy Markdown
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

Tug commented May 22, 2019

Copy link
Copy Markdown
Contributor

Code looks 👍

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

@Tug

Tug commented May 22, 2019

Copy link
Copy Markdown
Contributor

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

Tug commented May 22, 2019

Copy link
Copy Markdown
Contributor

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

@Tug Tug left a comment

Copy link
Copy Markdown
Contributor

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