ant-design [Table] Placement of "expandable row" is before children

3ks5zfa0  于 2022-11-19  发布在  其他
关注(0)|答案(1)|浏览(167)
  • I have searched the issues of this repository and believe that this is not a duplicate.

Steps to reproduce

<Table
  columns={columns}
  dataSource={data}
  expandable={{
    rowExpandable: (record) => {
      console.log('record ', record);
      return record.children ? true : false;
    },
    expandIcon: ({ expanded, onExpand, record }) => {
      if(!record.children || record.children.length === 0) return null;
      return expanded ? (
        <DownOutlined onClick={e => onExpand(record, e)} />
      ) : (
        <RightOutlined onClick={e => onExpand(record, e)} />
      )			  
    },
    expandedRowRender: (record, index, indent, expanded) => {
      console.log(record, index, indent, expanded);
      return <Button>Save</Button>;
    }
  }}/>

What is expected?

Expandable row should be below children

What is actually happening?

Expandable row currently placed above record children

EnvironmentInfo
antd4.6.5
React16.12.0
SystemMac
BrowserChrome 92.0.4515.131 (Official Build) (x86_64)

Raised question on stackoverflow: https://stackoverflow.com/questions/68826658/ant-design-table-need-to-place-expandable-row-before-parent-children

相关问题