-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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] Update Editor block inserter button styles and default text input placeholder/selection styles #52269
Conversation
Size Change: +212 B (0%) Total Size: 1.43 MB
ℹ️ View Unchanged
|
selectionColor={ selectionColor } | ||
selectionColor={ | ||
selectionColor ? selectionColor : defaultSelectionColor | ||
} |
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.
@geriux I was trying to make updating the cursor/caret/selection color as simple and non-disruptive as possible. Since selectionColor
is usually undefined
for most components using RichText, I thought perhaps that adding a default selection color to the base RichText component would work best. Then, whenever selectionColor
is passed as a prop, the selectionColor can still change, and will fallback to the default color if undefined. The objective was simplicity and reducing the chance of regressions, but I'm curious if you have any feedback here (especially before I update the failing snapshots where selectionColor was updated).
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.
This approach sounds good to me, having a default value in case it is not set, just a few cases would set a custom selectionColor
, for example, blocks like Button.
I've moved this logic to the RichText component though so that it would work for other cases like the PostTitle component. I also added a case to take into account block-based theme colors and color contrast detection, since I've encountered issues in light/dark mode using different block-based themes.
These changes were applied in 14d5695
@@ -43,8 +43,14 @@ function HeaderToolbar( { | |||
noContentSelected, | |||
} ) { | |||
const wasNoContentSelected = useRef( noContentSelected ); | |||
// eslint-disable-next-line no-unused-vars | |||
const [ isInserterOpen, setIsInserterOpen ] = useState( false ); |
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.
Although isInserterOpen
and other references to the open inserter are no longer used in this file, isInserterOpen
is still used in the media block insertion PR. Rather than remove all of the references here, // eslint-disable-next-line no-unused-vars
is used. This line can be removed once merged.
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.
I've removed this code in 3b4c5c2 👍
{ useExpandedMode && expandedModeViewText } | ||
</ToolbarButton> | ||
customContainerStyles={ buttonStyle } | ||
fixedRatio={ false } |
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.
By testing it a bit, I think we should add some hitSlop
to this button, currently, this is not implemented but it should be easy to do and it will improve the UX of tapping on this button. What do you think?
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.
Good idea, updated.
Flaky tests detected in 3b4c5c2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5509849401
|
…ead, also take into account block themes
# Conflicts: # packages/edit-post/src/components/header/header-toolbar/index.native.js # packages/react-native-editor/CHANGELOG.md
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! 🚀 FYI I've added some changes related to the selection color.
…dd/defer-script-loading-strategy * 'trunk' of https://github.com/WordPress/gutenberg: Update Changelog for 16.2.0 Adding support for defined IDs in `TextControl` component (#52028) Bump plugin version to 16.2.0 Revert "Bump plugin version to 16.2.0" Bump plugin version to 16.2.0 Add maxLength to LinkControl search items (#52523) [RNMobile] Update Editor block inserter button styles and default text input placeholder/selection styles (#52269) Site Editor: Reset device preview type when exiting the editing mode (#52566) Trim footnote anchors from excerpts (#52518) Add back old Navigation and File blocks JavaScript implementation when Gutenberg is not installed (#52553) Block Editor: Ensure synced patterns are accounted for in 'getAllowedBlocks' (#52546) Fix md5 class messed up with new block key (#52557) Fix entity cache misses for single posts due to string as recordKey (#52338) Make "My patterns" permanently visible (#52531) Hide site hub when resizing frame upwards to avoid overlap (#52180) Fix "Manage all patterns" link appearance (#52532) Update navigation menu title size & weight in detail panels (#52477) Site Editor Patterns: Ensure sidebar does not shrink when long pattern titles are used (#52547) Site Editor: Restore quick inserter 'Browse all' button (#52529) Patterns: update the title of Pattern block in the block inspector card (#52010)
Related PRs:
What?
Updates a few elements of the native editor styles and colors.
Why?
As part of ongoing design initiatives, some aspects of the native editor's appearance are being updated.
How?
Testing Instructions
Screenshots or screencast