diff --git a/packages/amis-ui/src/components/table/Head.tsx b/packages/amis-ui/src/components/table/Head.tsx index e751f8f97..437acf377 100644 --- a/packages/amis-ui/src/components/table/Head.tsx +++ b/packages/amis-ui/src/components/table/Head.tsx @@ -60,8 +60,17 @@ export default class Head extends React.PureComponent { tdColumns: Array; prependColumns(columns: Array) { - const {rowSelectionFixed, expandableFixed, draggable} = this.props; - if (draggable) { + const { + rowSelectionFixed, + expandableFixed, + draggable, + selectable, + expandable + } = this.props; + if (expandable) { + columns.unshift({}); + } + if (draggable || selectable) { columns.unshift({}); } else { if (expandableFixed) { diff --git a/packages/amis-ui/src/components/table/util.ts b/packages/amis-ui/src/components/table/util.ts index 255a2312c..c06dea830 100644 --- a/packages/amis-ui/src/components/table/util.ts +++ b/packages/amis-ui/src/components/table/util.ts @@ -234,7 +234,9 @@ function getAfterRightWidth( for (let i = doms.length - 0; i > index; i--) { if (columns && columns[i] && isFixedRightColumn(columns[i].fixed)) { const dom = doms[i] as HTMLElement; - width += dom.offsetWidth; + if (dom) { + width += dom.offsetWidth; + } } } return width;