File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
src/components/ConfirmAction Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 22
33# Changelog
44
5+ ## 1.3.1
6+
7+ 2025-8-1
8+
9+ ### Bug Fixes
10+
11+ - 🐞 Fix ` onOK ` handler is not fired in ` withConfirmAction ` HOC.
12+
513## 1.3.0
614
7152025-7-28
Original file line number Diff line number Diff line change 11{
22 "name" : " @tiny-codes/react-easy" ,
3- "version" : " 1.3.0 " ,
3+ "version" : " 1.3.1 " ,
44 "description" : " Simplify React and AntDesign development with practical components and hooks" ,
55 "keywords" : [
66 " react" ,
Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ export function withConfirmActionInternal<
6363 const setOnOk : ActionCompConstraint [ 'setOK' ] = useCallback ( ( handler ) => {
6464 saveFuncRef . current = handler ;
6565 } , [ ] ) ;
66+ const triggerOnOK = useCallback ( async ( ...args : any [ ] ) => {
67+ return saveFuncRef . current ?.( ...args ) ;
68+ } , [ ] ) ;
6669
6770 // Merge the default ref and custom ref and output to the parent component
6871 useImperativeHandle ( ref , ( ) => {
@@ -76,7 +79,7 @@ export function withConfirmActionInternal<
7679 const triggerDom = (
7780 < ConfirmActionWithRef
7881 { ...( propsWithDefaults as ConfirmActionProps < object , never > ) }
79- onOk = { saveFuncRef . current }
82+ onOk = { triggerOnOK }
8083 ref = { actionRef }
8184 />
8285 ) ;
You can’t perform that action at this time.
0 commit comments