From 4b6a2f564bb933d5411e75f664e859d6be891e61 Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Wed, 26 Apr 2023 12:23:07 -0400 Subject: [PATCH] 15768: fixed doubleclick bug Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- src/components/data-table/data-table.tsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/data-table/data-table.tsx b/src/components/data-table/data-table.tsx index bd81b89a72..cde4ffb9da 100644 --- a/src/components/data-table/data-table.tsx +++ b/src/components/data-table/data-table.tsx @@ -104,9 +104,9 @@ export const DataTable = withStyles(styles)( componentDidUpdate(prevProps: Readonly>) { if (prevProps.items !== this.props.items) { - console.log('BEFORE INIT', this.state); + // console.log('BEFORE INIT', this.state); this.initializeCheckedList(this.props.items); - console.log('AFTER INIT', this.state); + // console.log('AFTER INIT', this.state); } } @@ -115,7 +115,16 @@ export const DataTable = withStyles(styles)( selected: true, configurable: false, filters: createTree(), - render: (uuid) => this.handleCheck(uuid)}>, + render: (uuid) => ( + this.handleCheck(uuid)} + onDoubleClick={(ev) => ev.stopPropagation()} + > + ), }; initializeCheckedList = async (uuids: any[]) => { @@ -128,9 +137,8 @@ export const DataTable = withStyles(styles)( }; handleCheck = (uuid: string) => { - const checkedList = this.state; - const newCheckedList = { ...checkedList }; - newCheckedList[uuid] = !checkedList[uuid]; + const newCheckedList = { ...this.state }; + newCheckedList[uuid] = !this.state[uuid]; this.setState(newCheckedList); }; -- 2.30.2