Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/TableRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ export default class TableRow extends React.Component {
if (!visible) {
style.display = 'none';
}
if (this.onRowClick || this.onRowDoubleClick) {
style.cursor = 'pointer';
}

const rowClassName =
`${prefixCls} ${className} ${prefixCls}-level-${indent}`.trim();
Expand Down
73 changes: 51 additions & 22 deletions tests/__snapshots__/Table.expandRow.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ exports[`Table.expand controlled by expandedRowKeys 1`] = `
onMouseLeave={[Function]}
style={
Object {
"cursor": "pointer",
"height": null,
}
}>
Expand Down Expand Up @@ -321,6 +322,7 @@ exports[`Table.expand controlled by expandedRowKeys 1`] = `
onMouseLeave={[Function]}
style={
Object {
"cursor": "pointer",
"height": null,
}
}>
Expand Down Expand Up @@ -424,6 +426,7 @@ exports[`Table.expand controlled by expandedRowKeys 1`] = `
onMouseLeave={[Function]}
style={
Object {
"cursor": "pointer",
"height": null,
}
}>
Expand Down Expand Up @@ -713,6 +716,7 @@ exports[`Table.expand controlled by expandedRowKeys 2`] = `
onMouseLeave={[Function]}
style={
Object {
"cursor": "pointer",
"height": null,
}
}>
Expand Down Expand Up @@ -869,6 +873,7 @@ exports[`Table.expand controlled by expandedRowKeys 2`] = `
onMouseLeave={[Function]}
style={
Object {
"cursor": "pointer",
"height": null,
}
}>
Expand Down Expand Up @@ -1006,6 +1011,7 @@ exports[`Table.expand controlled by expandedRowKeys 2`] = `
onMouseLeave={[Function]}
style={
Object {
"cursor": "pointer",
"height": null,
}
}>
Expand Down Expand Up @@ -1085,7 +1091,8 @@ exports[`Table.expand expand all rows by default 1`] = `
<tbody
class="rc-table-tbody">
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
<span
Expand All @@ -1101,7 +1108,8 @@ exports[`Table.expand expand all rows by default 1`] = `
</td>
</tr>
<tr
class="rc-table-expanded-row rc-table-expanded-row-level-1">
class="rc-table-expanded-row rc-table-expanded-row-level-1"
style="cursor:pointer;">
<td
class=""
colspan="2">
Expand All @@ -1114,7 +1122,8 @@ exports[`Table.expand expand all rows by default 1`] = `
</td>
</tr>
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
<span
Expand All @@ -1130,7 +1139,8 @@ exports[`Table.expand expand all rows by default 1`] = `
</td>
</tr>
<tr
class="rc-table-expanded-row rc-table-expanded-row-level-1">
class="rc-table-expanded-row rc-table-expanded-row-level-1"
style="cursor:pointer;">
<td
class=""
colspan="2">
Expand Down Expand Up @@ -1330,6 +1340,7 @@ exports[`Table.expand expand row by click 1`] = `
onMouseLeave={[Function]}
style={
Object {
"cursor": "pointer",
"height": null,
}
}>
Expand Down Expand Up @@ -1467,6 +1478,7 @@ exports[`Table.expand expand row by click 1`] = `
onMouseLeave={[Function]}
style={
Object {
"cursor": "pointer",
"height": null,
}
}>
Expand Down Expand Up @@ -1570,6 +1582,7 @@ exports[`Table.expand expand row by click 1`] = `
onMouseLeave={[Function]}
style={
Object {
"cursor": "pointer",
"height": null,
}
}>
Expand Down Expand Up @@ -1702,7 +1715,8 @@ exports[`Table.expand expand rows by defaultExpandedRowKeys 1`] = `
<tbody
class="rc-table-tbody">
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
<span
Expand All @@ -1718,7 +1732,8 @@ exports[`Table.expand expand rows by defaultExpandedRowKeys 1`] = `
</td>
</tr>
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
<span
Expand All @@ -1734,7 +1749,8 @@ exports[`Table.expand expand rows by defaultExpandedRowKeys 1`] = `
</td>
</tr>
<tr
class="rc-table-expanded-row rc-table-expanded-row-level-1">
class="rc-table-expanded-row rc-table-expanded-row-level-1"
style="cursor:pointer;">
<td
class=""
colspan="2">
Expand Down Expand Up @@ -1788,7 +1804,8 @@ exports[`Table.expand renders expand icon as cell 1`] = `
<tbody
class="rc-table-tbody">
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="rc-table-row-expand-icon-cell">
<span
Expand All @@ -1804,7 +1821,8 @@ exports[`Table.expand renders expand icon as cell 1`] = `
</td>
</tr>
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="rc-table-row-expand-icon-cell">
<span
Expand Down Expand Up @@ -1855,7 +1873,8 @@ exports[`Table.expand renders expand icon to the specify column 1`] = `
<tbody
class="rc-table-tbody">
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
Lucy
Expand All @@ -1871,7 +1890,8 @@ exports[`Table.expand renders expand icon to the specify column 1`] = `
</td>
</tr>
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
Jack
Expand Down Expand Up @@ -1922,7 +1942,8 @@ exports[`Table.expand renders expand row correctly 1`] = `
<tbody
class="rc-table-tbody">
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
<span
Expand All @@ -1938,7 +1959,8 @@ exports[`Table.expand renders expand row correctly 1`] = `
</td>
</tr>
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
<span
Expand Down Expand Up @@ -1989,7 +2011,8 @@ exports[`Table.expand renders expend row class correctly 1`] = `
<tbody
class="rc-table-tbody">
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
<span
Expand All @@ -2005,7 +2028,8 @@ exports[`Table.expand renders expend row class correctly 1`] = `
</td>
</tr>
<tr
class="rc-table-expanded-row expand-row-test-class-name rc-table-expanded-row-level-1">
class="rc-table-expanded-row expand-row-test-class-name rc-table-expanded-row-level-1"
style="cursor:pointer;">
<td
class=""
colspan="2">
Expand All @@ -2018,7 +2042,8 @@ exports[`Table.expand renders expend row class correctly 1`] = `
</td>
</tr>
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
<span
Expand Down Expand Up @@ -2069,7 +2094,8 @@ exports[`Table.expand renders nested data correctly 1`] = `
<tbody
class="rc-table-tbody">
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
<span
Expand All @@ -2086,7 +2112,7 @@ exports[`Table.expand renders nested data correctly 1`] = `
</tr>
<tr
class="rc-table-row rc-table-row-level-1"
style="display:none;">
style="display:none;cursor:pointer;">
<td
class="">
<span
Expand All @@ -2102,7 +2128,8 @@ exports[`Table.expand renders nested data correctly 1`] = `
</td>
</tr>
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
<span
Expand Down Expand Up @@ -2153,7 +2180,8 @@ exports[`Table.expand renders tree row correctly 1`] = `
<tbody
class="rc-table-tbody">
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
<span
Expand All @@ -2170,7 +2198,7 @@ exports[`Table.expand renders tree row correctly 1`] = `
</tr>
<tr
class="rc-table-row rc-table-row-level-1"
style="display:none;">
style="display:none;cursor:pointer;">
<td
class="">
<span
Expand All @@ -2186,7 +2214,8 @@ exports[`Table.expand renders tree row correctly 1`] = `
</td>
</tr>
<tr
class="rc-table-row rc-table-row-level-0">
class="rc-table-row rc-table-row-level-0"
style="cursor:pointer;">
<td
class="">
<span
Expand Down
Loading