File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/main/src/components/SegmentedButton Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -76,14 +76,17 @@ const SegmentedButton: FC<SegmentedButtonPropTypes> = forwardRef(
7676 }
7777
7878 const handleSegmentedButtonItemSelected = useCallback (
79- ( e ) => {
79+ ( originalOnclick ) => ( e ) => {
8080 const newSelectedKey = e . getParameter ( 'selectedKey' ) ;
8181 if ( newSelectedKey !== internalSelectedKey ) {
8282 setSelectedKey ( newSelectedKey ) ;
8383 if ( typeof onItemSelected === 'function' ) {
8484 onItemSelected ( Event . of ( null , e . getOriginalEvent ( ) , e . getParameters ( ) ) ) ;
8585 }
8686 }
87+ if ( typeof originalOnclick === 'function' ) {
88+ originalOnclick ( e ) ;
89+ }
8790 } ,
8891 [ internalSelectedKey , setSelectedKey , onItemSelected ]
8992 ) ;
@@ -125,7 +128,7 @@ const SegmentedButton: FC<SegmentedButtonPropTypes> = forwardRef(
125128 key : item . props . id ,
126129 selected : internalSelectedKey === item . props . id ,
127130 disabled : disabled === true ? disabled : item . props . disabled ,
128- onClick : handleSegmentedButtonItemSelected
131+ onClick : handleSegmentedButtonItemSelected ( item . props . onClick )
129132 } )
130133 ) }
131134 </ ul >
You can’t perform that action at this time.
0 commit comments