Repository navigation
SelectControl: Fix default options showing the Select placeholder - #85172
ntsekouras merged 5 commits into
Conversation
🤖 PR meta 🤖🎉 PropsIf 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. Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +141 B (0%) Total Size: 8.97 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Regression: updating a specific option will only change its value and will not corrupt others in
|
There was a problem hiding this comment.
This sounds like a big enough issue that warrants to be fixed upstream (the wordpress/ui package)? cc @ciampo @mirka
This is not an "issue" or a bug per se, it's just how the component is meant to function, although I understand that it can trip consumers.
I think that the development warning, documentation, and tests in @wordpress/ui are already a good set of changes. At most, we could consider adding a dedicated migration guide that highlights this particular aspect.
The default-to-empty-string conversions should stay in the consumers, preserving their saved values and the shared component's native form serialization.
83afed7 to
8adb1d3
Compare
mirka
left a comment
There was a problem hiding this comment.
I'll also work on a migration guide with these findings from all the migrations.
8adb1d3 to
3a54888
Compare
…85172) Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: oandregal <oandregal@git.wordpress.org>
|
I just cherry-picked this PR to the wp/7.2 branch to get it included in the next release: 9ac2f99 |
This updates the pinned commit hash of the Gutenberg repository from `be6a50be6834e922b9db12c75c9a2cd817b2db59` to `d72020a651eda64dcc53b5dbd5b9d5bd511c4cc9` (version 24.3.0-rc.1). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@be6a50b...d72020a - BorderControl: Remove double focus outline (WordPress/gutenberg#85173) - Snackbar: Use design system focus ring (WordPress/gutenberg#85168) - SelectControl: Fix default options showing the `Select` placeholder (WordPress/gutenberg#85172) - Actions API: Remove the unsupported `single` action context (WordPress/gutenberg#85186) - Client-side media: Upgrade wasm-vips to 0.0.19 and raise memory budgets accordingly (WordPress/gutenberg#84980) - Styles: Fix inconsistent 'Elements' tools panel heading level (WordPress/gutenberg#85247) - `media-utils`/MediaEdit: use design system focus ring (WordPress/gutenberg#84940) - Icons: Add new form based icons. (WordPress/gutenberg#84074) (WordPress/gutenberg#85360) - Navigation: keep custom CSS off inner list containers (WordPress/gutenberg#84881) (WordPress/gutenberg#85367) - Navigation: keep Global Styles custom CSS off inner list containers (WordPress/gutenberg#85366) - Edit as HTML: Show design system focus ring on the HTML textarea (WordPress/gutenberg#85266) (WordPress/gutenberg#85359) - Icons: Restore the missing speech bubble in postComments (WordPress/gutenberg#85275) - Block Directory: Standardize downloadable block focus indicators (WordPress/gutenberg#85307) - Global Styles: Add icons and tweak styling for element and block buttons (WordPress/gutenberg#85363) (WordPress/gutenberg#85414) - Tests: Stop asserting Core lacks the core fields functions (WordPress/gutenberg#85201) - Meta Boxes: Use the design system focus ring for the panel toggle (WordPress/gutenberg#85355) (WordPress/gutenberg#85410) - DataViews: Use the design system focus ring for list items. (WordPress/gutenberg#85358) (WordPress/gutenberg#85435) - Components: Standardize checkbox and radio focus outlines (WordPress/gutenberg#85379) (WordPress/gutenberg#85436) - UI: Use solid brand highlights for popup items (WordPress/gutenberg#84087) - Media: Preserve EXIF metadata when converting HEIC to JPEG client-side (WordPress/gutenberg#82040) - Icons: Add error, info and postComments to the core-admin collection (WordPress/gutenberg#85452) - UnitControl: Use the design system outline for the unit select focus ring (WordPress/gutenberg#85444) - Page List: Keep pages visible in the Navigation sidebar in contentOnly (WordPress/gutenberg#85357) - Icons: Add new asterisk icon (WordPress/gutenberg#85442) (WordPress/gutenberg#85498) - wp-env: Keep Debian security updates in Bullseye-based images (WordPress/gutenberg#85469) - Editor: Guard entity preload filters and share entity actions/fields logic (WordPress/gutenberg#85390) (WordPress/gutenberg#85499) - UI: Scale Spinner stroke width with its size (WordPress/gutenberg#85378) - [WP 7.2] Fix the block-library TypeScript test project (WordPress/gutenberg#85533) - Editor: Vertically center the Categories loading spinner (WordPress/gutenberg#85563) - DataViews: Render table bulk actions outside the table (WordPress/gutenberg#85250) (WordPress/gutenberg#85571) - Record e2e traces only when a failed test is retried (WordPress/gutenberg#85428) - Writing flow: fix triple click in a list item selecting the next item (WordPress/gutenberg#85569) - Build: Limit concurrent wp-build builds (WordPress/gutenberg#79889) - Icons: Promote Dashicon replacements to `core-admin` and map their Dashicons (WordPress/gutenberg#85541) Props peterwilsoncc, mamaduka. See #66340 git-svn-id: https://develop.svn.wordpress.org/trunk@64796 602fd350-edb4-49c9-b593-d223f7449a82
This updates the pinned commit hash of the Gutenberg repository from `be6a50be6834e922b9db12c75c9a2cd817b2db59` to `d72020a651eda64dcc53b5dbd5b9d5bd511c4cc9` (version 24.3.0-rc.1). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@be6a50b...d72020a - BorderControl: Remove double focus outline (WordPress/gutenberg#85173) - Snackbar: Use design system focus ring (WordPress/gutenberg#85168) - SelectControl: Fix default options showing the `Select` placeholder (WordPress/gutenberg#85172) - Actions API: Remove the unsupported `single` action context (WordPress/gutenberg#85186) - Client-side media: Upgrade wasm-vips to 0.0.19 and raise memory budgets accordingly (WordPress/gutenberg#84980) - Styles: Fix inconsistent 'Elements' tools panel heading level (WordPress/gutenberg#85247) - `media-utils`/MediaEdit: use design system focus ring (WordPress/gutenberg#84940) - Icons: Add new form based icons. (WordPress/gutenberg#84074) (WordPress/gutenberg#85360) - Navigation: keep custom CSS off inner list containers (WordPress/gutenberg#84881) (WordPress/gutenberg#85367) - Navigation: keep Global Styles custom CSS off inner list containers (WordPress/gutenberg#85366) - Edit as HTML: Show design system focus ring on the HTML textarea (WordPress/gutenberg#85266) (WordPress/gutenberg#85359) - Icons: Restore the missing speech bubble in postComments (WordPress/gutenberg#85275) - Block Directory: Standardize downloadable block focus indicators (WordPress/gutenberg#85307) - Global Styles: Add icons and tweak styling for element and block buttons (WordPress/gutenberg#85363) (WordPress/gutenberg#85414) - Tests: Stop asserting Core lacks the core fields functions (WordPress/gutenberg#85201) - Meta Boxes: Use the design system focus ring for the panel toggle (WordPress/gutenberg#85355) (WordPress/gutenberg#85410) - DataViews: Use the design system focus ring for list items. (WordPress/gutenberg#85358) (WordPress/gutenberg#85435) - Components: Standardize checkbox and radio focus outlines (WordPress/gutenberg#85379) (WordPress/gutenberg#85436) - UI: Use solid brand highlights for popup items (WordPress/gutenberg#84087) - Media: Preserve EXIF metadata when converting HEIC to JPEG client-side (WordPress/gutenberg#82040) - Icons: Add error, info and postComments to the core-admin collection (WordPress/gutenberg#85452) - UnitControl: Use the design system outline for the unit select focus ring (WordPress/gutenberg#85444) - Page List: Keep pages visible in the Navigation sidebar in contentOnly (WordPress/gutenberg#85357) - Icons: Add new asterisk icon (WordPress/gutenberg#85442) (WordPress/gutenberg#85498) - wp-env: Keep Debian security updates in Bullseye-based images (WordPress/gutenberg#85469) - Editor: Guard entity preload filters and share entity actions/fields logic (WordPress/gutenberg#85390) (WordPress/gutenberg#85499) - UI: Scale Spinner stroke width with its size (WordPress/gutenberg#85378) - [WP 7.2] Fix the block-library TypeScript test project (WordPress/gutenberg#85533) - Editor: Vertically center the Categories loading spinner (WordPress/gutenberg#85563) - DataViews: Render table bulk actions outside the table (WordPress/gutenberg#85250) (WordPress/gutenberg#85571) - Record e2e traces only when a failed test is retried (WordPress/gutenberg#85428) - Writing flow: fix triple click in a list item selecting the next item (WordPress/gutenberg#85569) - Build: Limit concurrent wp-build builds (WordPress/gutenberg#79889) - Icons: Promote Dashicon replacements to `core-admin` and map their Dashicons (WordPress/gutenberg#85541) Props peterwilsoncc, mamaduka. See #66340 Built from https://develop.svn.wordpress.org/trunk@64796 git-svn-id: http://core.svn.wordpress.org/trunk@63946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…85172) Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: oandregal <oandregal@git.wordpress.org>

What
Follow up of: #85167
After the migration to the
@wordpress/uiSelectControl(#84345, #84546), selects with a default option stored as an empty string show theSelectplaceholder instead of the option's label when it's selected. Base UI treats an empty string value as no selection.This PR fixes the rest of the affected selects:
Default.Default.Default based on area (<header>).PostTemplatePanel/PageTemplateon classic themes: the default template. Core doesn't render these since Editor: Stabilize the DataForm-based inspector #85081, so this only affects plugins that render them.Select widget.The options that are a choice of their own (1-4) get a non-empty value that is mapped back to
'', so the saved values don't change.Select widgetmeans no widget, so it usesnullinstead, which Base UI renders with its label.It also adds a development warning to
SelectControlwhen an item has an empty stringvalue, so it doesn't regress again.Testing Instructions
Position optionsmenu, enablePositionand observe the select showsDefault. Switch toStickyand back toDefault.Settingstab open theAdvancedpanel. Observe theHTML elementselect showsDefault based on area (<header>).Default.Select widget.Screenshots or screencast
Use of AI Tools
Generated with Opus 5.5 and adjusted/reviewed manually.