feat(@wallet/NetworkSelector): Single selection updates
When it is single selection: - Close combobox when an option is selected. - Don't allow uncheck.
This commit is contained in:
parent
e8b1dad80f
commit
ebbb22f514
|
@ -115,8 +115,10 @@ Popup {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if(root.multiSelection)
|
if(root.multiSelection)
|
||||||
toggleModelIsActive()
|
toggleModelIsActive()
|
||||||
else
|
else {
|
||||||
radioButton.toggle()
|
// Don't allow uncheck
|
||||||
|
if(!radioButton.checked) radioButton.toggle()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleModelIsActive() {
|
function toggleModelIsActive() {
|
||||||
|
@ -142,8 +144,12 @@ Popup {
|
||||||
size: StatusRadioButton.Size.Large
|
size: StatusRadioButton.Size.Large
|
||||||
ButtonGroup.group: radioBtnGroup
|
ButtonGroup.group: radioBtnGroup
|
||||||
checked: model.index === 0
|
checked: model.index === 0
|
||||||
onCheckedChanged: if(checked) root.singleNetworkSelected(model.chainId, model.chainName, model.iconUrl)
|
onCheckedChanged: {
|
||||||
onToggled: if(checked) root.singleNetworkSelected(model.chainId, model.chainName, model.iconUrl)
|
if(checked && !root.multiSelection) {
|
||||||
|
root.singleNetworkSelected(model.chainId, model.chainName, model.iconUrl)
|
||||||
|
close()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue