Skip to content

Commit b830cbc

Browse files
authored
querySelector: :scope -> & (#4011)
* `querySelector`: `:scope` -> `&` * tweak failOnConsole
1 parent 154a598 commit b830cbc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/DataGrid.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr
411411
);
412412

413413
const headerSelectionValue = useMemo((): HeaderRowSelectionContextValue => {
414-
// no rows to select = explicitely unchecked
414+
// no rows to select = explicitly unchecked
415415
let hasSelectedRow = false;
416416
let hasUnselectedRow = false;
417417

@@ -736,7 +736,7 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr
736736
setDraggedOverRowIdx(overRowIdx);
737737
const ariaRowIndex = headerAndTopSummaryRowsCount + overRowIdx + 1;
738738
const el = gridEl.querySelector(
739-
`:scope > [aria-rowindex="${ariaRowIndex}"] > [aria-colindex="${activePosition.idx + 1}"]`
739+
`& > [aria-rowindex="${ariaRowIndex}"] > [aria-colindex="${activePosition.idx + 1}"]`
740740
);
741741
scrollIntoView(el);
742742
}
@@ -1293,11 +1293,11 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr
12931293
}
12941294

12951295
function getRowToScroll(gridEl: HTMLDivElement) {
1296-
return gridEl.querySelector<HTMLDivElement>(':scope > [role="row"][tabindex="0"]');
1296+
return gridEl.querySelector<HTMLDivElement>('& > [role="row"][tabindex="0"]');
12971297
}
12981298

12991299
function getCellToScroll(gridEl: HTMLDivElement) {
1300-
return gridEl.querySelector<HTMLDivElement>(':scope > [role="row"] > [tabindex="0"]');
1300+
return gridEl.querySelector<HTMLDivElement>('& > [role="row"] > [tabindex="0"]');
13011301
}
13021302

13031303
function isSamePosition(p1: Position, p2: Position) {

test/failOnConsole.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ beforeAll(() => {
1919
};
2020
});
2121

22-
afterEach(({ task, signal }) => {
22+
afterEach(() => {
2323
// Wait for the test and all `afterEach` hooks to complete to ensure all logs are caught
24-
onTestFinished(() => {
24+
onTestFinished(({ task, signal }) => {
2525
// avoid failing test runs twice
26-
if (task.result!.state !== 'fail' || signal.aborted) {
26+
if (task.result!.state !== 'fail' && !signal.aborted) {
2727
expect
2828
.soft(
2929
consoleErrorOrConsoleWarnWereCalled,

0 commit comments

Comments
 (0)