@@ -91,18 +91,18 @@ export default class CarbonRadioTable extends React.PureComponent<Props, State>
91
91
breadcrumbs . push ( { label : strings ( 'nRows' , table . body . length ) } )
92
92
}
93
93
94
- return < Toolbar className = "kui--data-table-toolbar-top" breadcrumbs = { breadcrumbs . length > 0 && breadcrumbs } />
95
- }
96
-
97
- private bottomToolbar ( ) {
98
94
if ( this . props . selectedIdx >= 0 ) {
99
95
const selectedRow = this . props . table . body [ this . props . selectedIdx ]
100
- return < Toolbar > { this . row ( selectedRow , this . props . selectedIdx ) } </ Toolbar >
96
+ if ( selectedRow . nameIdx !== undefined ) {
97
+ breadcrumbs . push ( { label : radioTableCellToString ( selectedRow . cells [ selectedRow . nameIdx ] ) } )
98
+ }
101
99
}
100
+
101
+ return < Toolbar className = "kui--data-table-toolbar-top" breadcrumbs = { breadcrumbs . length > 0 && breadcrumbs } />
102
102
}
103
103
104
104
private row ( row : RadioTableRow , ridx : number , head = false , onSelect ?: ( ) => void ) {
105
- const isSelected = ! onSelect && ! head && ridx === this . props . selectedIdx - this . props . offset
105
+ const isSelected = ! head && ridx === this . props . selectedIdx - this . props . offset
106
106
const name = this . id ( ridx )
107
107
108
108
// notes: label is needed for selection
@@ -111,7 +111,11 @@ export default class CarbonRadioTable extends React.PureComponent<Props, State>
111
111
label
112
112
head = { head }
113
113
key = { ridx }
114
- className = { 'kui--radio-table-row' + ( head ? ' kui--radio-table-row--header-row' : '' ) }
114
+ className = {
115
+ 'kui--radio-table-row' +
116
+ ( head ? ' kui--radio-table-row--header-row' : '' ) +
117
+ ( isSelected ? ' kui--inverted-color-context bx--structured-list-row--selected' : '' )
118
+ }
115
119
data-name = { row . nameIdx !== undefined ? radioTableCellToString ( row . cells [ row . nameIdx ] ) : name }
116
120
data-is-selected = { isSelected || undefined }
117
121
>
@@ -164,9 +168,7 @@ export default class CarbonRadioTable extends React.PureComponent<Props, State>
164
168
private body ( ) {
165
169
return (
166
170
< StructuredListBody className = "kui--radio-table-body" >
167
- { this . props . table . body . map (
168
- ( row , idx ) => idx !== this . props . selectedIdx && this . row ( row , idx , false , row . onSelect )
169
- ) }
171
+ { this . props . table . body . map ( ( row , idx ) => this . row ( row , idx , false , row . onSelect ) ) }
170
172
</ StructuredListBody >
171
173
)
172
174
}
@@ -177,7 +179,6 @@ export default class CarbonRadioTable extends React.PureComponent<Props, State>
177
179
< div className = "kui--screenshotable" >
178
180
< Card
179
181
header = { this . props . title && this . topToolbar ( ) }
180
- footer = { this . bottomToolbar ( ) }
181
182
footerClassName = "kui--inverted-color-context kui--no-padding"
182
183
>
183
184
< div className = "kui--data-table-container" >
0 commit comments