diff --git a/src/react/components/pages/editorPage/canvas.tsx b/src/react/components/pages/editorPage/canvas.tsx index 7006a741f..93e0e6ca3 100644 --- a/src/react/components/pages/editorPage/canvas.tsx +++ b/src/react/components/pages/editorPage/canvas.tsx @@ -508,6 +508,7 @@ export default class Canvas extends React.Component } const regionIndex = this.state.currentAsset.regions.findIndex(r => r.id === region.id); if (regionIndex !== -1) { + // TODO: update this part since we should not modify state directly. this.state.currentAsset.regions.splice(regionIndex, 1, region); } }); @@ -537,6 +538,13 @@ export default class Canvas extends React.Component } selectedRegion.isTableRegion = true; } + } else { + // non-table region, clear table related properties. + for(const region of selectedRegions) { + region.isTableRegion = false; + delete (region as ITableRegion).rowKey; + delete (region as ITableRegion).columnKey; + } } this.updateRegions([...selectedRegions, ...regions]);