Skip to content

Commit 399692e

Browse files
authored
Merge pull request #467 from mashmatrix/support-slds-2-toggle
Update `Toggle` for SLDS2
2 parents cb5c907 + f5c8377 commit 399692e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/scripts/Toggle.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,25 @@ export const Toggle = createFC<ToggleProps, { isFormElement: boolean }>(
4949
<input
5050
ref={inputRef}
5151
id={id}
52-
name='checkbox'
5352
type='checkbox'
54-
aria-describedby='toggle-desc'
5553
{...rprops}
5654
onChange={onChange}
5755
/>
58-
<span className='slds-checkbox_faux_container' aria-live='assertive'>
56+
<span className='slds-checkbox_faux_container'>
5957
<span className='slds-checkbox_faux' />
6058
<span className='slds-checkbox_on'>Enabled</span>
6159
<span className='slds-checkbox_off'>Disabled</span>
6260
</span>
6361
</label>
6462
);
65-
const formElemProps = { id, label, required, error, cols, elementRef };
63+
const formElemProps = {
64+
controlId: id,
65+
label,
66+
required,
67+
error,
68+
cols,
69+
elementRef,
70+
};
6671
return <FormElement {...formElemProps}>{toggle}</FormElement>;
6772
},
6873
{ isFormElement: true }

0 commit comments

Comments
 (0)