File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -581,6 +581,9 @@ const ZenstackFormInputInternal = (props: ZenstackFormInputProps) => {
581581 const handleChange = ( event : any ) => {
582582 const fieldName = props . field . name ;
583583
584+ // Call custom element's onChange if it exists
585+ if ( props . customElement ?. props . onChange ) props . customElement . props . onChange ( event ) ;
586+
584587 // Call original onChange
585588 props . form . getInputProps ( fieldName ) . onChange ( event ) ;
586589
@@ -619,9 +622,10 @@ const ZenstackFormInputInternal = (props: ZenstackFormInputProps) => {
619622
620623 // Filter out props that are already defined in customElement
621624 const finalProps = Object . fromEntries (
622- Object . entries ( baseProps ) . filter ( ( [ key ] ) =>
623- props . customElement ! . props [ key ] === undefined ,
624- ) ,
625+ Object . entries ( baseProps ) . filter ( ( [ key ] ) => {
626+ if ( key === 'onChange' ) return true ; // Don't override onChange
627+ return props . customElement ! . props [ key ] === undefined ;
628+ } ) ,
625629 ) ;
626630 // For custom elements, we need to prioritize the loading placeholder
627631 if ( props . isLoadingInitialData ) finalProps . placeholder = LOADING_PLACEHOLDER ;
You can’t perform that action at this time.
0 commit comments