[Mobile] - RichText - Parse CSS values and avoid setting undefined ones#47080
Merged
[Mobile] - RichText - Parse CSS values and avoid setting undefined ones#47080
Conversation
|
Size Change: +14 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 461a3c5. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3905143730
|
11d2ae9 to
f4bc5b4
Compare
added 2 commits
January 12, 2023 19:47
…d undefined or NaN values being sent to the native TextInput
f4bc5b4 to
461a3c5
Compare
geriux
pushed a commit
that referenced
this pull request
Jan 13, 2023
…es (#47080) * parseCssUnitToPx - Fix issue with decimals in math expressions * Mobile - RichText - Parse CSS values from line height values and avoid undefined or NaN values being sent to the native TextInput
4 tasks
geriux
pushed a commit
that referenced
this pull request
Jan 13, 2023
* Release script: Update react-native-editor version to 1.87.0 * Release script: Update with changes from 'npm run core preios' * Mobile - Update changelog * Release script: Update react-native-editor version to 1.87.1 * Release script: Update with changes from 'npm run core preios' * [RNMobile] Remove unnecessary negative margin around empty gallery block (#47086) This PR removes some unwanted negative margin space from empty gallery blocks on native. * [Mobile] - RichText - Parse CSS values and avoid setting undefined ones (#47080) * parseCssUnitToPx - Fix issue with decimals in math expressions * Mobile - RichText - Parse CSS values from line height values and avoid undefined or NaN values being sent to the native TextInput * Mobile - Update Changelog * Mobile - Update Podfile.lock Co-authored-by: Siobhan Bamber <siobhan@automattic.com>
geriux
pushed a commit
that referenced
this pull request
Jan 19, 2023
* Revert "[Mobile] - RichText - Parse CSS values and avoid setting undefined ones (#47080)" This reverts commit 2d44f06. * parseCssUnitToPx - Fix issue with decimals in math expressions * Mobile - Avoid passing NaN line height values to Aztec. It also disables passing font size and line height values on Android for pre elements. * Mobile - Preformatted - Update snapshot to remove the fontSize value as it will be set by Aztec for Android
fluiddot
pushed a commit
that referenced
this pull request
Jan 19, 2023
* Revert "[Mobile] - RichText - Parse CSS values and avoid setting undefined ones (#47080)" This reverts commit 2d44f06. * parseCssUnitToPx - Fix issue with decimals in math expressions * Mobile - Avoid passing NaN line height values to Aztec. It also disables passing font size and line height values on Android for pre elements. * Mobile - Preformatted - Update snapshot to remove the fontSize value as it will be set by Aztec for Android
dcalhoun
added a commit
that referenced
this pull request
Jan 19, 2023
* Release script: Update react-native-editor version to 1.87.0 * Release script: Update with changes from 'npm run core preios' * Mobile - Update changelog * Release script: Update react-native-editor version to 1.87.1 * Release script: Update with changes from 'npm run core preios' * [RNMobile] Remove unnecessary negative margin around empty gallery block (#47086) This PR removes some unwanted negative margin space from empty gallery blocks on native. * [Mobile] - RichText - Parse CSS values and avoid setting undefined ones (#47080) * parseCssUnitToPx - Fix issue with decimals in math expressions * Mobile - RichText - Parse CSS values from line height values and avoid undefined or NaN values being sent to the native TextInput * Mobile - Update Changelog * Release script: Update react-native-editor version to 1.87.2 * Release script: Update with changes from 'npm run core preios' * Add boolean contentStyle and clientId check to Column Edit InnerBlocks * Mobile - Column block - Move parentWidth to a const variable * docs: Update changelog * [Mobile] - Line-height and font-size regression fixes (#47284) * Revert "[Mobile] - RichText - Parse CSS values and avoid setting undefined ones (#47080)" This reverts commit 2d44f06. * parseCssUnitToPx - Fix issue with decimals in math expressions * Mobile - Avoid passing NaN line height values to Aztec. It also disables passing font size and line height values on Android for pre elements. * Mobile - Preformatted - Update snapshot to remove the fontSize value as it will be set by Aztec for Android * Update react-native-editor changelog Co-authored-by: Gerardo <gerardo.pacheco@automattic.com> Co-authored-by: Siobhan Bamber <siobhan@automattic.com> Co-authored-by: Derek Blank <derekpblank@gmail.com> Co-authored-by: Carlos Garcia <fluiddot@gmail.com>
fluiddot
added a commit
that referenced
this pull request
Jan 31, 2023
* Release script: Update react-native-editor version to 1.87.0 * Release script: Update with changes from 'npm run core preios' * Mobile - Update changelog * Release script: Update react-native-editor version to 1.87.1 * Release script: Update with changes from 'npm run core preios' * [RNMobile] Remove unnecessary negative margin around empty gallery block (#47086) This PR removes some unwanted negative margin space from empty gallery blocks on native. * [Mobile] - RichText - Parse CSS values and avoid setting undefined ones (#47080) * parseCssUnitToPx - Fix issue with decimals in math expressions * Mobile - RichText - Parse CSS values from line height values and avoid undefined or NaN values being sent to the native TextInput * Mobile - Update Changelog * Release script: Update react-native-editor version to 1.87.2 * Release script: Update with changes from 'npm run core preios' * Add boolean contentStyle and clientId check to Column Edit InnerBlocks * Mobile - Column block - Move parentWidth to a const variable * docs: Update changelog * [Mobile] - Line-height and font-size regression fixes (#47284) * Revert "[Mobile] - RichText - Parse CSS values and avoid setting undefined ones (#47080)" This reverts commit 2d44f06. * parseCssUnitToPx - Fix issue with decimals in math expressions * Mobile - Avoid passing NaN line height values to Aztec. It also disables passing font size and line height values on Android for pre elements. * Mobile - Preformatted - Update snapshot to remove the fontSize value as it will be set by Aztec for Android * Update react-native-editor changelog * Release script: Update react-native-editor version to 1.87.3 * Release script: Update with changes from 'npm run core preios' * [Mobile] Native Bridge: Fix insert blocks not handling raw string properly in unsupported block editor (#47472) * Update react-native-editor changelog --------- Co-authored-by: Gerardo <gerardo.pacheco@automattic.com> Co-authored-by: Siobhan Bamber <siobhan@automattic.com> Co-authored-by: David Calhoun <438664+dcalhoun@users.noreply.github.com> Co-authored-by: Derek Blank <derekpblank@gmail.com> Co-authored-by: Renato Augusto Gama dos Santos <renato_0603@hotmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Related PRs:
This PR adds support for parsing CSS line-height values.
What?
Some themes are including line-height values like
calc( 1em + 0.875rem )in theirtheme.jsonconfiguration which currently breaks the editor in development mode, in production doesn't crash but it doesn't work as expected.Why?
To support current and future themes that include CSS vars or CSS expressions as line-height values.
How?
First by updating the
getPxFromCssUnitutil which was currently breaking while trying to parse values likecalc( 1em + 0.875rem )where it was splitting the+character and the decimals as well. Where it should only split math expression values:+,-,*, etc.Second by updating the
getLineHeightmethod to parse these values.It also includes a test in both the helper and RichText to take into account these cases.
Testing Instructions
Repeat with a different theme.
Testing Instructions for Keyboard
N/A
Screenshots or screencast