Skip to content

Commit 9ed087a

Browse files
Ayesha Mazumdarbrandonferrua
authored andcommitted
fix(datatable): Adjusts styling to account for edited and error cells when row selected (#3167)
* fix(datatable): Adjusts styling to account fro edited and error cells when row is selected * fix(datatable): Increase specificity of edited cells
1 parent cd98ab6 commit 9ed087a

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

ui/components/data-tables/inline-edit/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
* @selector .slds-cell-edit
157157
* @restrict .slds-table_edit th, .slds-table_edit td
158158
*/
159-
.slds-cell-edit {
159+
.slds-table .slds-cell-edit {
160160
outline: 0; // @TODO: This came from `has-focus` (watch for overreaching)
161161

162162
&.slds-has-focus { // This is the focused state

ui/components/data-tables/inline-edit/example.jsx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,35 @@ export let states = [
321321
</Container>
322322
)
323323
},
324+
{
325+
id: 'row-selected-with-edited-cell',
326+
label: 'Row Selected with an Edited Cell',
327+
element: (
328+
<Container>
329+
<Table isEditable style={{ width: '66.75rem' }}>
330+
<Thead
331+
actionableMode
332+
columns={columns}
333+
hasErrorColumn
334+
mainColumnWidth="8.75rem"
335+
/>
336+
<tbody>
337+
{_.times(rows.length, i => (
338+
<InlineEditTr
339+
key={i}
340+
index={i + 1}
341+
className={i === 0 ? 'slds-is-selected' : null}
342+
{...rows[i]}
343+
rowSelected={i === 0 ? true : null}
344+
actionableMode
345+
showEditedCell
346+
/>
347+
))}
348+
</tbody>
349+
</Table>
350+
</Container>
351+
)
352+
},
324353
{
325354
id: 'row-error',
326355
label: 'Error - Row level on save (Actionable mode)',
@@ -354,6 +383,37 @@ export let states = [
354383
document.getElementById('button-01').focus()
355384
`
356385
},
386+
{
387+
id: 'row-error-and-selected',
388+
label:
389+
'Error - Row level on save (Actionable mode) with entire row selected',
390+
element: (
391+
<Container>
392+
<Table isEditable style={{ width: '66.75rem' }}>
393+
<Thead
394+
actionableMode
395+
columns={columns}
396+
hasErrorColumn
397+
mainColumnWidth="8.75rem"
398+
/>
399+
<tbody>
400+
{_.times(rows.length, i => (
401+
<InlineEditTr
402+
key={i}
403+
index={i + 1}
404+
className={i === 0 ? 'slds-is-selected' : null}
405+
{...rows[i]}
406+
rowSelected={i === 0 ? true : null}
407+
actionableMode
408+
showCellError
409+
showRowError
410+
/>
411+
))}
412+
</tbody>
413+
</Table>
414+
</Container>
415+
)
416+
},
357417
{
358418
id: 'row-error-focused',
359419
label: 'Error indicator - Focused (Actionable mode)',

0 commit comments

Comments
 (0)