Skip to content

Commit

Permalink
fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tlabaj committed Aug 27, 2024
1 parent c54abdc commit 33f2488
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class TableEditableDemo extends React.Component<TableProps, TableState> {
</SelectOption>
))}
onToggle={(_event: any) => {
this.onToggle(updatedProps.isSelectOpen, rowIndex as number, cellIndex as number);
this.onToggle(rowIndex as number, cellIndex as number);
}}
selections={updatedProps.selected}
/>
Expand All @@ -164,7 +164,7 @@ export class TableEditableDemo extends React.Component<TableProps, TableState> {
editableSelectProps: {
variant: 'checkbox',
'aria-label': 'Row 1 cell 5 content',
onOpenChange: (isOpen: boolean) => this.onOpenChange(isOpen, 0, 4)
onOpenChange: () => this.onOpenChange(0, 4)
}
}
}
Expand Down Expand Up @@ -257,7 +257,7 @@ export class TableEditableDemo extends React.Component<TableProps, TableState> {
</SelectOption>
))}
onToggle={(_event: any) => {
this.onToggle(updatedProps.isSelectOpen, rowIndex as number, cellIndex as number);
this.onToggle(rowIndex as number, cellIndex as number);
}}
selections={updatedProps.selected}
/>
Expand All @@ -278,7 +278,7 @@ export class TableEditableDemo extends React.Component<TableProps, TableState> {
editableSelectProps: {
variant: 'single',
'aria-label': 'Row 2 cell 5 content',
onOpenChange: (isOpen: boolean) => this.onOpenChange(isOpen, 1, 4)
onOpenChange: () => this.onOpenChange(1, 4)
}
}
}
Expand Down Expand Up @@ -377,27 +377,27 @@ export class TableEditableDemo extends React.Component<TableProps, TableState> {
};

// set open state if component closes menu on click (e.g. when you click outside of the menu)
onOpenChange = (isOpen: boolean, rowIndex: number, cellIndex: number) => {
onOpenChange = (rowIndex: number, cellIndex: number) => {
const newRows = Array.from(this.state.rows);
const rowCells = newRows[rowIndex as number].cells;
if (rowCells) {
const cell = rowCells[cellIndex as number];
if (cell) {
(cell as IRowCell).props.isSelectOpen = isOpen;
(cell as IRowCell).props.isSelectOpen = !(cell as IRowCell).props.isSelectOpen;
this.setState({
rows: newRows
});
}
}
};

onToggle = (isOpen: boolean, rowIndex: number, cellIndex: number) => {
onToggle = (rowIndex: number, cellIndex: number) => {
const newRows = Array.from(this.state.rows);
const rowCells = newRows[rowIndex].cells;
if (rowCells) {
const cell = rowCells[cellIndex as number];
if (cell) {
(cell as IRowCell).props.isSelectOpen = isOpen;
(cell as IRowCell).props.isSelectOpen = !(cell as IRowCell).props.isSelectOpen;
this.setState({
rows: newRows
});
Expand Down

0 comments on commit 33f2488

Please sign in to comment.