Skip to content

Commit

Permalink
Fix:ConfirmDialog:confirmDialog method in unstyled mode, the pop-up w…
Browse files Browse the repository at this point in the history
…indow style not apply (#5776)
  • Loading branch information
kl-nevermore authored Jan 16, 2024
1 parent fdd9e23 commit 9b4e7a2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions components/lib/confirmdialog/ConfirmDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 9b4e7a2

Please sign in to comment.