From 9b4e7a2d9d8b56e704c927212cc92fb414ec9fed Mon Sep 17 00:00:00 2001 From: "kl.nevermore" Date: Tue, 16 Jan 2024 21:09:50 +0800 Subject: [PATCH] =?UTF-8?q?Fix:ConfirmDialog=EF=BC=9AconfirmDialog=20metho?= =?UTF-8?q?d=20in=20unstyled=20mode,=20the=20pop-up=20window=20style=20not?= =?UTF-8?q?=20apply=20(#5776)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/lib/confirmdialog/ConfirmDialog.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/components/lib/confirmdialog/ConfirmDialog.js b/components/lib/confirmdialog/ConfirmDialog.js index 82e94bcd37..8fccf6577d 100644 --- a/components/lib/confirmdialog/ConfirmDialog.js +++ b/components/lib/confirmdialog/ConfirmDialog.js @@ -34,8 +34,18 @@ export const ConfirmDialog = React.memo( const confirmProps = React.useRef(null); const isCallbackExecuting = React.useRef(false); const focusElementOnHide = React.useRef(null); - const getCurrentProps = () => confirmProps.current || props; - const getPropValue = (key) => (confirmProps.current || props)[key]; + + const getCurrentProps = () => { + let group = props.group; + + if (confirmProps.current) { + group = confirmProps.current.group; + } + + return Object.assign({}, props, confirmProps.current, { group }); + }; + + const getPropValue = (key) => getCurrentProps()[key]; const callbackFromProp = (key, ...param) => ObjectUtils.getPropValue(getPropValue(key), param); const acceptLabel = getPropValue('acceptLabel') || localeOption('accept');