Unverified Commit bcddacba authored by Yuge Zhang's avatar Yuge Zhang Committed by GitHub
Browse files

Fix bug when expanding rows not on the first page (#3006)

parent 5eec7ea5
......@@ -249,7 +249,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
{
key: '_expand',
name: '',
onRender: (item, index): any => {
onRender: (item): any => {
return (
<Icon
aria-hidden={true}
......@@ -269,8 +269,9 @@ class TableList extends React.Component<TableListProps, TableListState> {
} else {
this._expandedTrialIds.delete(newItem.id);
}
const newItems = [...this.state.displayedItems];
newItems[index as number] = newItem;
const newItems = this.state.displayedItems.map(item =>
item.id === newItem.id ? newItem : item
);
this.setState({
displayedItems: newItems
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment