@@ -18,6 +18,7 @@ import {
1818 type GridColumn ,
1919 type GridLayoutOptions ,
2020} from '../components/ui/data-table/data-table-grid' ;
21+ import { DATA_TABLE_ROW_FRAME_CLASS } from '../components/ui/data-table/data-table-row-classes' ;
2122import { useDataTable } from '../components/ui/data-table/use-data-table' ;
2223import { LoadingScope } from '../components/ui/loading-scope' ;
2324
@@ -316,15 +317,24 @@ describe('DataTable grid layout', () => {
316317 it ( 'draws every grid cell 48px high and the plain text cell on one line' , ( ) => {
317318 const { container } = render ( < Grid /> ) ;
318319 const gridBody = gridBodyMarkup ( container ) ;
319- const cellBoxes = [ ... gridBody . matchAll ( / c l a s s = " ( f l e x h - 1 2 i t e m s - c e n t e r b o r d e r - b b o r d e r - o d s - b o r d e r [ ^ " ] * ) " / g ) ] . map (
320- match => match [ 1 ] ,
321- ) ;
320+ const cellBoxes = [
321+ ... gridBody . matchAll ( / c l a s s = " ( i s o l a t e f l e x h - 1 2 i t e m s - c e n t e r b o r d e r - b b o r d e r - o d s - b o r d e r [ ^ " ] * ) " / g ) ,
322+ ] . map ( match => match [ 1 ] ) ;
322323 // 3 rows x (select, name, owner, more).
323324 expect ( cellBoxes ) . toHaveLength ( 12 ) ;
324325 // A string cell (the owner column's grid form) is the default one-line text.
325326 expect ( screen . getByText ( 'grid:Ada' ) . className ) . toContain ( 'truncate' ) ;
326327 } ) ;
327328
329+ it ( 'keeps what a cell draws inside the cell: every cell is its own stacking context' , ( ) => {
330+ // An input at `z-10` in a scrolling cell painted over the pinned column (`z-[1]`). Each cell isolates its content.
331+ const { container } = render ( < Grid /> ) ;
332+ const cells = [ ...gridBodyMarkup ( container ) . matchAll ( / c l a s s = " ( [ ^ " ] * \b h - 1 2 i t e m s - c e n t e r [ ^ " ] * ) " / g) ] . map ( m => m [ 1 ] ) ;
333+ expect ( cells . length ) . toBeGreaterThan ( 0 ) ;
334+ for ( const cell of cells ) expect ( cell . split ( ' ' ) ) . toContain ( 'isolate' ) ;
335+ expect ( DATA_TABLE_ROW_FRAME_CLASS . split ( ' ' ) ) . toContain ( 'isolate' ) ;
336+ } ) ;
337+
328338 it ( 'keeps every row 48px high when a column has two-line cells' , ( ) => {
329339 const twoLine = COLUMNS . map ( column =>
330340 column . id === 'owner' ? { ...column , meta : { ...column . meta , gridSecondLine : true } } : column ,
0 commit comments