Skip to content

Commit

Permalink
Exclude from tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka committed Jan 30, 2023
1 parent 3458a05 commit 9353567
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/tree-grid/cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import type { TreeGridCellProps } from './types';
function UnforwardedTreeGridCell(
{
children,
withoutGridItem,
withoutGridItem = false,
...props
}: WordPressComponentProps< TreeGridCellProps, 'td', false >,
ref: React.ForwardedRef< any >
) {
return (
<td { ...props } role="gridcell">
{ withoutGridItem ? (
children
<>{ children }</>
) : (
<TreeGridItem ref={ ref }>{ children }</TreeGridItem>
) }
Expand Down
10 changes: 6 additions & 4 deletions packages/components/src/tree-grid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ function UnforwardedTreeGrid(

if (
hasModifierKeyPressed ||
! [ UP, DOWN, LEFT, RIGHT, HOME, END ].includes( keyCode )
! ( [ UP, DOWN, LEFT, RIGHT, HOME, END ] as number[] ).includes(
keyCode
)
) {
return;
}
Expand Down Expand Up @@ -95,7 +97,7 @@ function UnforwardedTreeGrid(
activeRow.getAttribute( 'aria-expanded' ) === 'false' &&
keyCode === RIGHT;

if ( [ LEFT, RIGHT ].includes( keyCode ) ) {
if ( ( [ LEFT, RIGHT ] as number[] ).includes( keyCode ) ) {
// Calculate to the next element.
let nextIndex;
if ( keyCode === LEFT ) {
Expand Down Expand Up @@ -179,7 +181,7 @@ function UnforwardedTreeGrid(
// Prevent key use for anything else. This ensures Voiceover
// doesn't try to handle key navigation.
event.preventDefault();
} else if ( [ UP, DOWN ].includes( keyCode ) ) {
} else if ( ( [ UP, DOWN ] as number[] ).includes( keyCode ) ) {
// Calculate the rowIndex of the next row.
const rows = Array.from(
treeGridElement.querySelectorAll( '[role="row"]' )
Expand Down Expand Up @@ -233,7 +235,7 @@ function UnforwardedTreeGrid(
// Prevent key use for anything else. This ensures Voiceover
// doesn't try to handle key navigation.
event.preventDefault();
} else if ( [ HOME, END ].includes( keyCode ) ) {
} else if ( ( [ HOME, END ] as number[] ).includes( keyCode ) ) {
// Calculate the rowIndex of the next row.
const rows = Array.from(
treeGridElement.querySelectorAll( '[role="row"]' )
Expand Down
3 changes: 1 addition & 2 deletions packages/components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"src/navigation",
"src/palette-edit",
"src/panel",
"src/toolbar",
"src/tree-grid"
"src/toolbar"
]
}

0 comments on commit 9353567

Please sign in to comment.