(fix)修复radio-group调用setSelected方法时更新selected值
This commit is contained in:
parent
f09e0ab216
commit
043face92b
|
@ -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', '')
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue