(fix)修复radio-group调用setSelected方法时更新selected值

This commit is contained in:
wangchangqi 2022-11-29 13:11:30 +08:00
parent f09e0ab216
commit 043face92b
2 changed files with 10 additions and 2 deletions

View File

@ -242,11 +242,14 @@ export class StarSelectDialog extends StarBaseDialog {
this.reparentThenRestore?.()
}
/**
* handleCancel onselect
* cancel confirm 退
*/
handleSelect(e: Event) {
this.onselect?.(e)
if (this.multiple === false) {
super.handleCancel(e)
this.reparentThenRestore?.()
this.handleCancel(e)
} else {
if (this.radioGroup.getSelected() === '') {
this.confirmButton.setAttribute('disabled', '')

View File

@ -19,6 +19,10 @@ export class StarRadioGroup extends StarBaseElement {
display: flex;
flex-direction: row;
}
:host([disabled]) {
opacity: 0.5;
pointer-events: none;
}
`,
]
}
@ -81,6 +85,7 @@ export class StarRadioGroup extends StarBaseElement {
radio.checked = false
}
}
this.selected = this.getSelected()
this.emit('change')
return true
} catch (err) {