diff --git a/src/DataGrid.tsx b/src/DataGrid.tsx index 536fdc43e1..4826785dd5 100644 --- a/src/DataGrid.tsx +++ b/src/DataGrid.tsx @@ -411,7 +411,7 @@ export function DataGrid(props: DataGridPr ); const headerSelectionValue = useMemo((): HeaderRowSelectionContextValue => { - // no rows to select = explicitely unchecked + // no rows to select = explicitly unchecked let hasSelectedRow = false; let hasUnselectedRow = false; @@ -736,7 +736,7 @@ export function DataGrid(props: DataGridPr setDraggedOverRowIdx(overRowIdx); const ariaRowIndex = headerAndTopSummaryRowsCount + overRowIdx + 1; const el = gridEl.querySelector( - `:scope > [aria-rowindex="${ariaRowIndex}"] > [aria-colindex="${activePosition.idx + 1}"]` + `& > [aria-rowindex="${ariaRowIndex}"] > [aria-colindex="${activePosition.idx + 1}"]` ); scrollIntoView(el); } @@ -1293,11 +1293,11 @@ export function DataGrid(props: DataGridPr } function getRowToScroll(gridEl: HTMLDivElement) { - return gridEl.querySelector(':scope > [role="row"][tabindex="0"]'); + return gridEl.querySelector('& > [role="row"][tabindex="0"]'); } function getCellToScroll(gridEl: HTMLDivElement) { - return gridEl.querySelector(':scope > [role="row"] > [tabindex="0"]'); + return gridEl.querySelector('& > [role="row"] > [tabindex="0"]'); } function isSamePosition(p1: Position, p2: Position) { diff --git a/test/failOnConsole.ts b/test/failOnConsole.ts index a7b990a6fc..d04c4f8005 100644 --- a/test/failOnConsole.ts +++ b/test/failOnConsole.ts @@ -19,11 +19,11 @@ beforeAll(() => { }; }); -afterEach(({ task, signal }) => { +afterEach(() => { // Wait for the test and all `afterEach` hooks to complete to ensure all logs are caught - onTestFinished(() => { + onTestFinished(({ task, signal }) => { // avoid failing test runs twice - if (task.result!.state !== 'fail' || signal.aborted) { + if (task.result!.state !== 'fail' && !signal.aborted) { expect .soft( consoleErrorOrConsoleWarnWereCalled,