Skip to content

Commit 87dda6a

Browse files
adiitxaAditya Gaikwad
andauthored
[docs][Switch] Use slotProps.input instead of deprecated inputProps for accessible controlled switch (#46625)
Co-authored-by: Aditya Gaikwad <[email protected]>
1 parent 422289f commit 87dda6a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/data/material/components/switches/ControlledSwitches.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function ControlledSwitches() {
1212
<Switch
1313
checked={checked}
1414
onChange={handleChange}
15-
inputProps={{ 'aria-label': 'controlled' }}
15+
slotProps={{ input: { 'aria-label': 'controlled' } }}
1616
/>
1717
);
1818
}

docs/data/material/components/switches/ControlledSwitches.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function ControlledSwitches() {
1212
<Switch
1313
checked={checked}
1414
onChange={handleChange}
15-
inputProps={{ 'aria-label': 'controlled' }}
15+
slotProps={{ input: { 'aria-label': 'controlled' } }}
1616
/>
1717
);
1818
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Switch
22
checked={checked}
33
onChange={handleChange}
4-
inputProps={{ 'aria-label': 'controlled' }}
4+
slotProps={{ input: { 'aria-label': 'controlled' } }}
55
/>

0 commit comments

Comments
 (0)