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
4 changes: 4 additions & 0 deletions packages/dataviews/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

- DataViews: Fix `compact` density clipping and remove top/bottom padding. [#77054](https://github.com/WordPress/gutenberg/pull/77054)

### Code Quality

- DataViewsPicker: Remove unnecessary ref callbacks in grid and table layouts. [#77179](https://github.com/WordPress/gutenberg/pull/77179)

## 14.0.0 (2026-04-01)

### Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,10 @@ function GridItem< Item >( {
}: GridItemProps< Item > ) {
const { showTitle = true, showMedia = true, showDescription = true } = view;
const id = getItemId( item );
const elementRef = useRef< HTMLElement | null >( null );
const elementRef = useRef< HTMLButtonElement >( null );

const isSelected = selection.includes( id );

const setElementRef = ( element: HTMLElement | null ) => {
elementRef.current = element;
};

useIntersectionObserver( elementRef, posinset );

const renderedMediaField = mediaField?.render ? (
Expand All @@ -102,7 +98,7 @@ function GridItem< Item >( {

return (
<Composite.Item
ref={ setElementRef }
ref={ elementRef }
aria-label={
titleField
? titleField.getValue( { item } ) || __( '(no title)' )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ function TableRow< Item >( {
const isSelected = selection.includes( id );

const [ isHovered, setIsHovered ] = useState( false );
const elementRef = useRef< HTMLElement | null >( null );

const setElementRef = ( element: HTMLElement | null ) => {
elementRef.current = element;
};
const elementRef = useRef< HTMLButtonElement >( null );

useIntersectionObserver( elementRef, posinset );
const {
Expand All @@ -129,7 +125,7 @@ function TableRow< Item >( {
return (
<Composite.Item
key={ id }
ref={ setElementRef }
ref={ elementRef }
render={ ( { children, ...props } ) => (
<tr
className={ clsx( 'dataviews-view-table__row', {
Expand Down
Loading