Skip to content

Commit

Permalink
Mobile - Preformatted block - Fix showing the default background color (
Browse files Browse the repository at this point in the history
#36883)

* Mobile - Preformatted block - Fix showing the default background color

* Mobile - Preformatted block - Remove unnecessary optional chaining check

* Mobile - Update CHANGELOG
  • Loading branch information
geriux committed Nov 29, 2021
1 parent baaa22d commit 65487d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block-library/src/preformatted/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ export function PreformattedEdit( props ) {
...( style?.fontSize && { fontSize: style.fontSize } ),
...( style?.color && { color: style.color } ),
};
const hasBaseColors =
style?.baseColors && Object.entries( style.baseColors ).length !== 0;
const containerStyles = [
wpBlockPreformatted,
style?.backgroundColor && { backgroundColor: style.backgroundColor },
style?.baseColors &&
hasBaseColors &&
! style?.backgroundColor &&
styles[ 'wp-block-preformatted__no-background' ],
];
Expand Down
1 change: 1 addition & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ For each user feature we should also add a importance categorization label to i

## Unreleased
- [**] [iOS] Fix scroll update when typing in RichText component [#36914]
- [*] [Preformatted block] Fix an issue where the background color is not showing up for standard themes. [#36883]

## 1.67.0
- [**] Adds Clipboard Link Suggestion to Image block and Button block [#35972]
Expand Down

0 comments on commit 65487d2

Please sign in to comment.