File tree Expand file tree Collapse file tree 3 files changed +22
-16
lines changed 
daisyui/src/widgets/CheckboxWidget 
primereact/src/CheckboxWidget 
semantic-ui/src/CheckboxWidget Expand file tree Collapse file tree 3 files changed +22
-16
lines changed Original file line number Diff line number Diff line change @@ -42,19 +42,25 @@ export default function CheckboxWidget<
4242
4343  /** Handle focus events 
4444   */ 
45-   const  handleFocus  =  useCallback ( ( )  =>  { 
46-     if  ( onFocus )  { 
47-       onFocus ( id ,  value ) ; 
48-     } 
49-   } ,  [ onFocus ,  id ,  value ] ) ; 
45+   const  handleFocus  =  useCallback ( 
46+     ( event : FocusEvent < HTMLInputElement > )  =>  { 
47+       if  ( onFocus )  { 
48+         onFocus ( id ,  event . target . checked ) ; 
49+       } 
50+     } , 
51+     [ onFocus ,  id ] , 
52+   ) ; 
5053
5154  /** Handle blur events 
5255   */ 
53-   const  handleBlur  =  useCallback ( ( )  =>  { 
54-     if  ( onBlur )  { 
55-       onBlur ( id ,  value ) ; 
56-     } 
57-   } ,  [ onBlur ,  id ,  value ] ) ; 
56+   const  handleBlur  =  useCallback ( 
57+     ( event : FocusEvent < HTMLInputElement > )  =>  { 
58+       if  ( onBlur )  { 
59+         onBlur ( id ,  event . target . checked ) ; 
60+       } 
61+     } , 
62+     [ onBlur ,  id ] , 
63+   ) ; 
5864
5965  /** Handle change events 
6066   * 
Original file line number Diff line number Diff line change @@ -47,10 +47,10 @@ export default function CheckboxWidget<
4747  ) ; 
4848
4949  const  required  =  schemaRequiresTrueValue < S > ( schema ) ; 
50-   const  _onChange  =  ( e : CheckboxChangeEvent )  =>  onChange  &&  onChange ( e . checked ) ; 
51-   const  _onBlur  =  ( )  =>  onBlur  &&  onBlur ( id ,  value ) ; 
52-   const  _onFocus  =  ( )  =>  onFocus  &&  onFocus ( id ,  value ) ; 
5350  const  checked  =  value  ===  'true'  ||  value  ===  true ; 
51+   const  _onChange  =  ( e : CheckboxChangeEvent )  =>  onChange  &&  onChange ( e . checked ) ; 
52+   const  _onBlur  =  ( e : FocusEvent < HTMLInputElement > )  =>  onBlur  &&  onBlur ( id ,  e . target . checked ) ; 
53+   const  _onFocus  =  ( e : FocusEvent < HTMLInputElement > )  =>  onFocus  &&  onFocus ( id ,  e . target . checked ) ; 
5454  const  description  =  options . description  ??  schema . description ; 
5555  const  primeProps  =  ( options . prime  ||  { } )  as  object ; 
5656
Original file line number Diff line number Diff line change @@ -58,10 +58,10 @@ export default function CheckboxWidget<
5858  // the "required" attribute if the field value must be "true", due to the 
5959  // "const" or "enum" keywords 
6060  const  required  =  schemaRequiresTrueValue < S > ( schema ) ; 
61-   const  _onChange  =  ( _ : FormEvent < HTMLInputElement > ,  data : CheckboxProps )  =>  onChange  &&  onChange ( data . checked ) ; 
62-   const  _onBlur  =  ( )  =>  onBlur  &&  onBlur ( id ,  value ) ; 
63-   const  _onFocus  =  ( )  =>  onFocus  &&  onFocus ( id ,  value ) ; 
6461  const  checked  =  value  ==  'true'  ||  value  ==  true ; 
62+   const  _onChange  =  ( _ : FormEvent < HTMLInputElement > ,  data : CheckboxProps )  =>  onChange  &&  onChange ( data . checked ) ; 
63+   const  _onBlur  =  ( event : FocusEvent < HTMLInputElement > )  =>  onBlur  &&  onBlur ( id ,  event . currentTarget . checked ) ; 
64+   const  _onFocus  =  ( event : FocusEvent < HTMLInputElement > )  =>  onFocus  &&  onFocus ( id ,  event . currentTarget . checked ) ; 
6565  const  description  =  options . description  ??  schema . description ; 
6666
6767  return  ( 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments