Skip to content

Commit

Permalink
fix(Dialog): fixed update button attribute not reset opentype (#3178)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarmywang authored Oct 9, 2024
1 parent d9babb5 commit fcfec5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default class Dialog extends SuperComponent {
class: [...cls, `${classPrefix}__button--${key}`],
externalClass: [...externalCls, `${prefix}-class-${key}`],
variant: rect.buttonVariant,
openType: '',
};

if (key === 'cancel' && rect.buttonVariant === 'base') {
Expand Down Expand Up @@ -95,7 +96,7 @@ export default class Dialog extends SuperComponent {
}
}

const hasOpenType = 'openType' in button;
const hasOpenType = !!button.openType;
if (!hasOpenType && ['confirm', 'cancel'].includes(type)) {
this[toCamel(`on-${type}`)]?.(type);
}
Expand Down

0 comments on commit fcfec5a

Please sign in to comment.