Repository navigation
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
mirka
left a comment
There was a problem hiding this comment.
It looks like theme.json supports any string as border width (e.g. thin, var()), and that gets sent down to this component. The component can't render those values correctly in that case, but regardless, is it a problem that we silently overwrite these intentional string values with 1px? (cc @aaronrobertshaw)
| - `FontSizePicker`: Remove Custom option from dropdown to prevent unexpected context changes during keyboard navigation ([#69038](https://github.com/WordPress/gutenberg/pull/69038)). | ||
|
|
||
| - `ComboboxControl`: Add an `isLoading` prop to show a loading spinner ([#68990](https://github.com/WordPress/gutenberg/pull/68990)) | ||
| - `BorderControl`: adjust `useBorderControlDropdown` hook to use `1px` width when selecting the border color initially without explicitly setting width ([#69112](https://github.com/WordPress/gutenberg/pull/69112)). |
There was a problem hiding this comment.
The changelog needs to be repositioned.
Also, I don't think we need to mention useBorderControlDropdown specifically, since that's internal.
|
Blocks may already have borders applied via global styles or custom CSS. In such cases, simultaneously adding a 1px width along with a color change might cause confusion. border.mp4
There was a similar discussion in the past regarding whether one border property should be changed simultaneously with another. #75431 (comment) Considering that opinion, it might be better not to add the 1px width. cc @aaronrobertshaw @ramonjd @andrewserong @talldan |
|
Thanks for the ping! In my testing, this PR introduces something similar to what was discussed over in #75431 (comment) There, the change discards the user's explicit color choice from global styles. Here, it's discarding the explicit width: Kapture.2026-08-26.at.11.45.26.mp4I think the idea that he user should be able to view the border immediately when setting a color and not a width is a worthy one to think about, but I don't think we should cause unexpected changes. A theme that defines a border width presumably wants to enforce that unless an editor explicitly changes it via the control, not via the side-effect of another control. |
What?
Fixes: #69094
undefinedon initial render to set the width to1pxfor border, if user adds/changes the color before explicitly setting the width.Why?
How?
undefinedcondition with the0width check.Testing Instructions
1pxwidth for border.Testing Instructions for Keyboard
Screenshots or screencast
BorderFix.mov