diff --git a/packages/react-integration/demo-app-ts/src/components/demos/TableDemo/TableEditableDemo.tsx b/packages/react-integration/demo-app-ts/src/components/demos/TableDemo/TableEditableDemo.tsx index 70633784332..3e42ebc8565 100644 --- a/packages/react-integration/demo-app-ts/src/components/demos/TableDemo/TableEditableDemo.tsx +++ b/packages/react-integration/demo-app-ts/src/components/demos/TableDemo/TableEditableDemo.tsx @@ -143,7 +143,7 @@ export class TableEditableDemo extends React.Component { ))} onToggle={(_event: any) => { - this.onToggle(updatedProps.isSelectOpen, rowIndex as number, cellIndex as number); + this.onToggle(rowIndex as number, cellIndex as number); }} selections={updatedProps.selected} /> @@ -164,7 +164,7 @@ export class TableEditableDemo extends React.Component { editableSelectProps: { variant: 'checkbox', 'aria-label': 'Row 1 cell 5 content', - onOpenChange: (isOpen: boolean) => this.onOpenChange(isOpen, 0, 4) + onOpenChange: () => this.onOpenChange(0, 4) } } } @@ -257,7 +257,7 @@ export class TableEditableDemo extends React.Component { ))} onToggle={(_event: any) => { - this.onToggle(updatedProps.isSelectOpen, rowIndex as number, cellIndex as number); + this.onToggle(rowIndex as number, cellIndex as number); }} selections={updatedProps.selected} /> @@ -278,7 +278,7 @@ export class TableEditableDemo extends React.Component { editableSelectProps: { variant: 'single', 'aria-label': 'Row 2 cell 5 content', - onOpenChange: (isOpen: boolean) => this.onOpenChange(isOpen, 1, 4) + onOpenChange: () => this.onOpenChange(1, 4) } } } @@ -377,13 +377,13 @@ export class TableEditableDemo extends React.Component { }; // 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 }); @@ -391,13 +391,13 @@ export class TableEditableDemo extends React.Component { } }; - 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 });