-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Mobile] - Fix crash when deleting a block #27683
Conversation
Size Change: +4 B (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does fix the issue and I think this is safe to merge to fix our current crashes!
However we might want to investigate why blocks.attributes[ blockId ]
is empty in the store, that shouldn't happen in theory, so we might be doing something wrong.
Definitely, this is not the only case where we do this so we should investigate it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job tracing this down @geriux 👍
Works as expected and the code LGTM 🎉
* Release script: Update react-native-editor version to 1.43.0 * Release script: Update with changes from 'npm run core preios' * [Mobile] Treat a string that only contains the formatting marker as empty for block formatting (#27583) * Treat a string that only contains the formatting marker as empty * Update changelog * Mobile - Fix some cases where getBlockAttributes can be null when removing a block (#27683) * Updated CHANGELOG for release. * Removed this entry from this release since it's a hotfix. * Fix RN editor package.json indentation Co-authored-by: Chip <[email protected]> Co-authored-by: Gerardo Pacheco <[email protected]> Co-authored-by: Joel Dean <[email protected]>
Gutenberg Mobile PR
-> wordpress-mobile/gutenberg-mobile#2892Fixes wordpress-mobile/gutenberg-mobile#2886
Description
This PR fixes some cases where
getBlockAttributes
can benull
(for example when deleting a block) causing a crash on the mobile editor.How has this been tested?
On the WordPress app with metro running
Case 1
Group
blockHeading
block with some text within theGroup
blockHeading
block and delete it using the toolbar menu (three dots) and then theRemove block
optionCase 2
Group
blockButtons
block within theGroup
blockButton
and a linkButtons
block and delete it using the toolbar menu (three dots) and then theRemove block
optionCase 3
About
layoutCreate page
Button
block Contact meRemove block
optionScreenshots
Types of changes
Checklist: