Skip to content

Commit

Permalink
Components: Fix React Compiler error for 'useScrollRectIntoView'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Oct 26, 2024
1 parent 0466f7d commit 4ceb079
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/tabs/tablist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ function useScrollRectIntoView(
const rightOverflow = childRightEdge + margin - parentRightEdge;
const leftOverflow = parentScroll - ( childLeft - margin );
if ( leftOverflow > 0 ) {
parent.scrollLeft = parentScroll - leftOverflow;
parent.scroll( { left: parentScroll - leftOverflow } );
} else if ( rightOverflow > 0 ) {
parent.scrollLeft = parentScroll + rightOverflow;
parent.scroll( { left: parentScroll + rightOverflow } );
}
}, [ margin, parent, rect ] );
}
Expand Down

0 comments on commit 4ceb079

Please sign in to comment.