-
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
[RNMobile] Highlight text: Check if style attribute value is defined during filtering #38670
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fluiddot
added
[Type] Bug
An existing feature does not function as intended
Mobile App - i.e. Android or iOS
Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
labels
Feb 9, 2022
fluiddot
changed the title
[RNMobile] Text color: Check if style attribute value is defined during filtering
[RNMobile] Highlight text: Check if style attribute value is defined during filtering
Feb 9, 2022
Size Change: 0 B Total Size: 1.14 MB ℹ️ View Unchanged
|
fluiddot
force-pushed
the
rnmobile/fix/text-color-style-undefined
branch
from
February 9, 2022 15:37
2579b67
to
447aa33
Compare
fluiddot
added
the
Mobile App - Automation
Label used to initiate Mobile App PR Automation
label
Feb 9, 2022
geriux
approved these changes
Feb 9, 2022
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.
LGTM! Thank you for handling this issue. I tested it on both iOS and Android and it fixes the bug. 🎉
mchowning
pushed a commit
that referenced
this pull request
Feb 9, 2022
…during filtering (#38670) * Check if style value is defined before removing extra spaces * Add test case for old text color format * Update react-native-editor changelog
This was referenced Feb 10, 2022
fluiddot
added a commit
that referenced
this pull request
Feb 10, 2022
* Release script: Update react-native-editor version to 1.70.0 * Release script: Update with changes from 'npm run core preios' * Add 1.70.0 section to react-native-editor changelog * Release script: Update react-native-editor version to 1.70.1 * Release script: Update with changes from 'npm run core preios' * [RNMobile] Gallery block: Fix crash when adding images and selecting a gallery item (#38238) * Add the native variant of MediaReplaceFlow Since the MediaReplaceFlow component is not implemented yet in the native version of the editor, we return an empty component instead. * Set MediaPlaceholder props by platform in gallery * Update react-native-editor changelog * Remove autoOpenMediaUpload from web props `autoOpenMediaUpload` prop is only used in the native version of the `MediaPlaceholder` component hence, we don't need to define it in the props set for the web version. * Add gallery block integration tests * Unify shared props between web and native * Add 1.70.1 section to react-native-editor changelog * Declare package visibility to query URL handler apps (#38377) * Declare package visibility to query URL handler apps * Update changelog * Update react-native-bridge changelog * Release script: Update react-native-editor version to 1.70.2 * Release script: Update with changes from 'npm run core preios' * Mobile - Rich Text - Validate link colors * Mobile - Rich Text - Update naming to match prop * Update Changelog * GutenbergDemo - Restore unwanted archs change * Release script: Update react-native-editor version to 1.70.3 * Release script: Update with changes from 'npm run core preios' * [RNMobile] Highlight text: Check if style attribute value is defined during filtering (#38670) * Check if style value is defined before removing extra spaces * Add test case for old text color format * Update react-native-editor changelog Co-authored-by: Carlos Garcia <fluiddot@gmail.com> Co-authored-by: Stefanos Togoulidis <stefanostogoulidis@gmail.com> Co-authored-by: Gerardo <gerardo.pacheco@automattic.com>
mchowning
pushed a commit
that referenced
this pull request
Feb 11, 2022
…during filtering (#38670) * Check if style value is defined before removing extra spaces * Add test case for old text color format * Update react-native-editor changelog
4 tasks
mchowning
added a commit
that referenced
this pull request
Feb 11, 2022
* Release script: Update react-native-editor version to 1.71.0 * Release script: Update with changes from 'npm run core preios' * Updare CHANGELOG to reflect changes in 1.71.0 * Tests: Enable post type UI for templates and template parts (#38486) * Tests: Enable post type UI for templates and template parts * Only enable UI for block themes * Mobile - Rich Text - Validate link colors (#38474) * Mobile - Rich Text - Validate link colors * Mobile - Rich Text - Update naming to match prop * Release script: Update react-native-editor version to 1.71.1 * Release script: Update with changes from 'npm run core preios' * [RNMobile] Highlight text: Check if style attribute value is defined during filtering (#38670) * Check if style value is defined before removing extra spaces * Add test case for old text color format * Update react-native-editor changelog * Update CHANGELOG with 1.71.1 changes * Fix incorrect CHANGELOG entry from previous commit Co-authored-by: Siobhan <siobhan@automattic.com> Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com> Co-authored-by: Gerardo Pacheco <gerardo.pacheco@automattic.com> Co-authored-by: Carlos Garcia <fluiddot@gmail.com>
ℹ️ This fix made it into WPAndroid 19.2-rc-3. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Mobile App - Automation
Label used to initiate Mobile App PR Automation
Mobile App - i.e. Android or iOS
Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
[Type] Bug
An existing feature does not function as intended
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes wordpress-mobile/gutenberg-mobile#4560.
Description
Following up on the changes introduced in #37915, I noticed that the value of the style attribute when it's being filtered might be
undefined
in some cases, especially when using the old text color format withspan
tag (reference).This case leads to a crash in the app because we try to access the value in:
gutenberg/packages/format-library/src/text-color/index.native.js
Line 184 in 93de664
This PR fixes the issue by assuring that the value is defined before using it.
Testing Instructions
Screenshots
N/A
Types of changes
Bug fix
Checklist:
*.native.js
files for terms that need renaming or removal).