Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions components/modal/ConfirmDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export default defineComponent<ConfirmDialogProps>({
onCancel,
onOk,
close,
okText,
closable = false,
zIndex,
afterClose,
Expand Down Expand Up @@ -141,9 +142,6 @@ export default defineComponent<ConfirmDialogProps>({
const prefixCls = props.prefixCls || 'ant-modal';
const contentPrefixCls = `${prefixCls}-confirm`;
const style = attrs.style || {};
const okText =
renderSomeContent(props.okText) ||
(okCancel ? locale.value.okText : locale.value.justOkText);
const mergedOkCancel = okCancel ?? type === 'confirm';
const autoFocusButton =
props.autoFocusButton === null ? false : props.autoFocusButton || 'ok';
Expand All @@ -157,6 +155,8 @@ export default defineComponent<ConfirmDialogProps>({
attrs.class,
);

const mergedLocal = locale.value;

const cancelButton = mergedOkCancel && (
<ActionButton
actionFn={onCancel}
Expand All @@ -165,7 +165,7 @@ export default defineComponent<ConfirmDialogProps>({
buttonProps={cancelButtonProps}
prefixCls={`${rootPrefixCls}-btn`}
>
{renderSomeContent(props.cancelText) || locale.value.cancelText}
{renderSomeContent(props.cancelText) || mergedLocal.cancelText}
</ActionButton>
);
return (
Expand Down Expand Up @@ -219,7 +219,7 @@ export default defineComponent<ConfirmDialogProps>({
buttonProps={okButtonProps}
prefixCls={`${rootPrefixCls}-btn`}
>
{okText}
{okText || (mergedOkCancel ? mergedLocal.okText : mergedLocal.justOkText)}
</ActionButton>
</div>
)}
Expand Down