fix: 修复 dropdownbutton 配置 confirmText 弹出来两次的问题 Close: #7378 (#7385)

This commit is contained in:
liaoxuezhi 2023-07-06 20:15:50 +08:00 committed by GitHub
parent 1a2cb0882e
commit c8d36ad8b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -250,7 +250,7 @@ export default class DropDownButton extends React.Component<
button: DropdownButton,
index: number | string
): React.ReactNode {
const {render, classnames: cx, data} = this.props;
const {render, classnames: cx, data, ignoreConfirm} = this.props;
index = typeof index === 'number' ? index.toString() : index;
if (typeof button !== 'string' && Array.isArray(button?.children)) {
@ -282,11 +282,17 @@ export default class DropDownButton extends React.Component<
['is-disabled']: isDisabled(button, data)
})}
>
{render(`button/${index}`, {
type: 'button',
...(button as any),
isMenuItem: true
})}
{render(
`button/${index}`,
{
type: 'button',
...(button as any)
},
{
isMenuItem: true,
ignoreConfirm: ignoreConfirm
}
)}
</li>
);
}