File tree Expand file tree Collapse file tree
@primereact/headless/src/switch
primereact/src/switch/root Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ export const useSwitch = withHeadless({
4040 type : 'checkbox' as const ,
4141 role : 'switch' as const ,
4242 checked : checkedState ,
43+ disabled : props . disabled ,
4344 'aria-checked' : checkedState ,
4445 ...( props . invalid && { 'aria-invalid' : true as const } ) ,
4546 ...( props . tabIndex !== undefined && { tabIndex : props . tabIndex } ) ,
Original file line number Diff line number Diff line change @@ -20,12 +20,7 @@ export const SwitchRoot = withComponent({
2020
2121 const switchHook = useSwitch ( useSwitchButtonProps ) ;
2222
23- const inputElementProps = {
24- id : props . inputId ,
25- disabled : props . disabled
26- } ;
27-
28- return { ...switchHook , inputElementProps } ;
23+ return switchHook ;
2924 } ,
3025 render ( instance ) {
3126 const {
@@ -37,15 +32,14 @@ export const SwitchRoot = withComponent({
3732 sx,
3833 // prop getters
3934 rootProps : headlessRootProps ,
40- inputProps : hookInputProps ,
41- inputElementProps
35+ inputProps : hookInputProps
4236 } = instance ;
4337
4438 const createInputElement = ( ) => {
4539 const inputProps = mergeProps (
4640 hookInputProps ,
47- inputElementProps ,
4841 {
42+ id : props . inputId ,
4943 className : cn ( cx ( 'input' ) , props . inputClassName ) ,
5044 style : props . inputStyle
5145 } ,
You can’t perform that action at this time.
0 commit comments