Skip to content

Commit 7951b8a

Browse files
committed
fix(data table): shared checkbox groups label id as a variable
1 parent 98a9b4b commit 7951b8a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ui/components/data-tables/responsive/example.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import classNames from 'classnames';
1111
// Partial(s)
1212
/// ////////////////////////////////////////
1313

14+
const checkboxRadioGroupHeaderId = 'check-group-header';
15+
1416
let Table = props => (
1517
<table
1618
className={classNames('slds-table slds-table_bordered', props.className)}
@@ -22,15 +24,15 @@ let Table = props => (
2224
let HeadRowData = props => (
2325
<tr className="slds-text-title_caps">
2426
<th className="slds-cell-shrink" scope="col">
25-
<span className="slds-assistive-text" id="check-group-header">
27+
<span className="slds-assistive-text" id={checkboxRadioGroupHeaderId}>
2628
Choose a row to select
2729
</span>
2830
<Checkbox
2931
hideLabel
3032
labelId={'check-button-label-all'}
3133
id={'checkbox-all'}
3234
label={'Select all'}
33-
groupId="check-group-header"
35+
groupId={checkboxRadioGroupHeaderId}
3436
checked={props.checked}
3537
/>
3638
</th>
@@ -130,7 +132,7 @@ let RowData = props => (
130132
labelId={`check-button-label-0${props.index}`}
131133
id={`checkbox-0${props.index}`}
132134
label={`Select item ${props.index}`}
133-
groupId="check-group-header"
135+
groupId={checkboxRadioGroupHeaderId}
134136
checked={props.checked}
135137
/>
136138
</td>

0 commit comments

Comments
 (0)