fix: item selector modal rendering blank on WordPress 7.0#748
Open
ross-mulcahy wants to merge 1 commit into
Open
fix: item selector modal rendering blank on WordPress 7.0#748ross-mulcahy wants to merge 1 commit into
ross-mulcahy wants to merge 1 commit into
Conversation
WordPress 7.0 applies display:flex (default row direction) to full-screen modal content. With the modal header visible, the row layout collapses the children container to zero width, pushing the DataViews table off-screen. Restore a column layout via an always-present rdb-dataviews-modal class on DataViewsModal. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Test this PR in [WordPress Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/admin.php?page=remote-data-blocks-settings","features":{"networking":true},"login":true,"preferredVersions":{"php":"8.2","wp":"latest"},"steps":[{"step":"setSiteOptions","options":{"blogname":"Remote Data Blocks PR#748","blogdescription":"Explore the Remote Data Blocks plugin in a WordPress Playground"}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://github.com/Automattic/remote-data-blocks/releases/download/ci-artifacts/pr-748-4a2001f57ea38be79b1d9e430e52b7a270cb290d.zip"},"options":{"activate":true,"targetFolderName":"remote-data-blocks"}}]}). |
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.
Summary
On WordPress 7.0, every item-selector modal (the DataViews-based "Select items" flow used by Shopify, Airtable, Google Sheets, etc.) renders blank: the modal opens, the footer shows the correct item count and pagination, but no rows are visible. There are no console errors. The plugin currently declares
Tested up to: 6.9.This is purely a presentation bug — the remote data query succeeds and the table is fully rendered in the DOM, just laid out off-screen.
Root cause
WordPress 7.0 ships new core CSS for full-screen modals (
load-styles.php,wp-components):Our selector modal uses
isFullScreenwith a visible header, so.components-modal__contenthas two children:.components-modal__header(sticky, full width).components-modal__children-container(holds the DataViews table)In the default row direction, the full-width header consumes the entire row, and the children container —
flex: 1 1 0%via the:last-childrule — collapses to width 0. The DataViews table inside it overflows to the right of the modal frame, fully rendered but invisible. Measured on a 1200px viewport:.components-modal__content.components-modal__header.components-modal__children-container.dataviews-view-tableCore's own full-screen modals (command palette, etc.) hide the header, so the children container is the only flex item and fills the row — which is why core never hits this.
Fix
Two small changes:
editor.scss— restore a column layout on the modal content:On WP ≤ 6.9 the content is
display: block, whereflex-directionis inert — so this is backwards compatible. The core rule uses:where()(zero specificity), so a plain class selector overrides it cleanly.DataViewsModal.tsx— always apply a baserdb-dataviews-modalclass to the modal. Previously the only stable hook was the caller-suppliedclassName, and the inline-binding caller (InlineBindingSelectNew.tsx) passes none — so its modal had the same bug with no class to target. This also fixes a latent issue wheresupportsItemSelectionmodals with an undefinedclassNamerendered a literal"undefined"class (`${ className } rdb-dataviews-bulk-actions-modal`).Verification
Reproduced and verified with
@wp-playground/cliusing the bundledshopify-mock-store-blockexample (mock.shop, no credentials needed):tsc --noEmit,eslint,wp-scripts lint-style, andnpm run buildall pass.Repro steps for reviewers:
Notes
position: fixedin the same area). This occurs on both 6.9 and 7.0, so it is pre-existing and intentionally out of scope here.readme.txtTested up to:is left at 6.9 — bumping it presumably belongs to a broader 7.0 compatibility pass / release process.🤖 Generated with Claude Code