Skip to content

Commit

Permalink
fix: table expandable row header has no top left border radius (ant-d…
Browse files Browse the repository at this point in the history
…esign#39781)

* fix: expandable row table header is rendered as td and has no top left border radius ant-design#39769

* test: update expandIconColumnIndex
  • Loading branch information
chunsch committed Dec 24, 2022
1 parent 189f912 commit 9d671ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions components/table/__tests__/Table.expand.test.tsx
Expand Up @@ -105,10 +105,10 @@ describe('Table.expand', () => {
);

// header has td element (a11y): https://github.com/react-component/table/pull/859
const tdNodeList = container.querySelectorAll('td');
const tdNodeList = container.querySelectorAll('tbody td');

expect(tdNodeList[2].textContent).toEqual('bamboo');
expect(tdNodeList[3].querySelector('.ant-table-row-expand-icon')).toBeTruthy();
expect(tdNodeList[0].textContent).toEqual('bamboo');
expect(tdNodeList[1].querySelector('.ant-table-row-expand-icon')).toBeTruthy();
});

it('work with selection', () => {
Expand All @@ -123,10 +123,10 @@ describe('Table.expand', () => {
rowSelection={{}}
/>,
);
const tdNodeList = container.querySelectorAll('td');
expect(tdNodeList[2].querySelector('.ant-checkbox-input')).toBeTruthy();
expect(tdNodeList[3].textContent).toEqual('bamboo');
expect(tdNodeList[4].querySelector('.ant-table-row-expand-icon')).toBeTruthy();
const tdNodeList = container.querySelectorAll('tbody td');
expect(tdNodeList[0].querySelector('.ant-checkbox-input')).toBeTruthy();
expect(tdNodeList[1].textContent).toEqual('bamboo');
expect(tdNodeList[2].querySelector('.ant-table-row-expand-icon')).toBeTruthy();
});
});
});
4 changes: 2 additions & 2 deletions components/table/style/radius.tsx
Expand Up @@ -36,11 +36,11 @@ const genRadiusStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
borderStartEndRadius: tableRadius,

'table > thead > tr:first-child': {
'th:first-child': {
'> *:first-child': {
borderStartStartRadius: tableRadius,
},

'th:last-child': {
'> *:last-child': {
borderStartEndRadius: tableRadius,
},
},
Expand Down

0 comments on commit 9d671ed

Please sign in to comment.