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

[ReactNative] Refactor block splitting code on paragraph and heading blocks #10690

Merged

Conversation

daniloercoli
Copy link
Contributor

In this PR I started the refactor of the code that handles block splitting (for Paragraph and Heading blocks) on Enter.KEY and tried to stay closer to the web implementation.

@diegoreymendez this is just a working in progress, but worth to get this merged since it will probably affect the Native wrapper around Aztec. See the hack here.

Internally there is a conversion from HTML to RichText format, and the position of the cursor obviously doesn't match. Consequence of this, the code that actually does the split uses a wrong index and split at "arbitrary" position.
Maybe just returning the "geographical" position of the cursor in Aztec will fix this issue. We need to investiga that better, so having this merged will help.

… and Heading blocks for mobile, tryin gto stay closer to the web version.
@daniloercoli daniloercoli 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 Oct 17, 2018
Copy link
Contributor

@diegoreymendez diegoreymendez left a comment

Choose a reason for hiding this comment

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

I configured my local environment to test this in Android too, and there truly isn't much to test... but at least I was able to check that it's not crashing.

@diegoreymendez diegoreymendez merged commit ca05c26 into master Oct 18, 2018
@diegoreymendez diegoreymendez deleted the rnmobile/split-para-heading-blocks-on-enter-step2 branch October 18, 2018 04:51
antpb pushed a commit to antpb/gutenberg that referenced this pull request Oct 26, 2018
… and Heading blocks for mobile, tryin gto stay closer to the web version. (WordPress#10690)
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