Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/dataviews/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

### Bug Fixes

- Grid layout: Apply `inert` through `inertValue` so the attribute works reliably ([#84072](https://github.com/WordPress/gutenberg/pull/84072)).
- Keep filter and item actions menus dismissible when their triggers become disabled ([#83791](https://github.com/WordPress/gutenberg/pull/83791)).
- Grid layout: measure the container as the grid attaches rather than waiting for the resize observer's first report, so the grid no longer renders a frame with every item in a full-width column of its own before snapping to its real column count ([#83752](https://github.com/WordPress/gutenberg/pull/83752)).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
useRef,
forwardRef,
} from '@wordpress/element';
import { inertValue } from '@wordpress/react-inert-value';
import { MEDIA_ASPECT_RATIOS } from '../../../constants';
import ItemActions from '../../dataviews-item-actions';
import DataViewsSelectionCheckbox from '../../dataviews-selection-checkbox';
Expand Down Expand Up @@ -343,7 +344,7 @@ export default function CompositeGrid< Item >( {
data,
isInfiniteScroll,
className,
inert,
inert = false,
isLoading,
view,
fields,
Expand Down Expand Up @@ -453,7 +454,7 @@ export default function CompositeGrid< Item >( {
role="feed"
focusWrap
// @ts-expect-error `inert` is not declared in React 18's HTML attribute types.
inert={ inert }
inert={ inertValue( inert ) }

@ntsekouras ntsekouras Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove the call from here, since this feels a better place to convert inert?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, fixing in 27291d7. CompositeGrid has a boolean inert prop, with boolean values. inertValue is used only on the "leafs" of the tree, when passing inert to an actual DOM element.

>
{ /* Render placeholders for unloaded items in first row */ }
{ Array.from( { length: placeholdersNeeded } ).map(
Expand Down Expand Up @@ -551,7 +552,7 @@ export default function CompositeGrid< Item >( {
aria-rowcount={ totalRows }
ref={ resizeObserverRef }
// @ts-expect-error `inert` is not declared in React 18's HTML attribute types.
inert={ inert }
inert={ inertValue( inert ) }
>
{ chunk( data, gridColumns ).map( ( row, i ) => (
<Composite.Row
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import clsx from 'clsx';
import { Spinner } from '@wordpress/components';
import { __, sprintf } from '@wordpress/i18n';
import { inertValue } from '@wordpress/react-inert-value';
import { Stack } from '@wordpress/ui';
import type { ViewGridProps } from '../../../types';
import getDataByGroup from '../utils/get-data-by-group';
Expand Down Expand Up @@ -63,7 +62,7 @@ function ViewGrid< Item >( {
className: clsx( className, {
'is-refreshing': ! isInfiniteScroll && isDelayedLoading,
} ),
inert: inertValue( ! isInfiniteScroll && isLoading ),
inert: ! isInfiniteScroll && !! isLoading,
isLoading,
view,
fields,
Expand Down
Loading