mirror of https://github.com/anoshenko/rui.git
Bug fixing
This commit is contained in:
parent
42067e1791
commit
03a1fd063a
7
popup.go
7
popup.go
|
|
@ -606,7 +606,7 @@ func (popup *popupData) Get(tag PropertyName) any {
|
|||
return nil
|
||||
|
||||
case Buttons:
|
||||
if value := popup.getRaw(DismissEvent); value != nil {
|
||||
if value := popup.getRaw(Buttons); value != nil {
|
||||
if buttons, ok := value.([]popupButton); ok {
|
||||
result := make([]PopupButton, 0, len(buttons))
|
||||
for _, button := range buttons {
|
||||
|
|
@ -614,6 +614,7 @@ func (popup *popupData) Get(tag PropertyName) any {
|
|||
Title: button.title,
|
||||
Type: button.buttonType,
|
||||
}
|
||||
if button.onClick != nil {
|
||||
switch listener := button.onClick.rawListener().(type) {
|
||||
case string:
|
||||
btn.Binding = listener
|
||||
|
|
@ -621,6 +622,7 @@ func (popup *popupData) Get(tag PropertyName) any {
|
|||
case func(Popup):
|
||||
btn.OnClick = listener
|
||||
}
|
||||
}
|
||||
result = append(result, btn)
|
||||
}
|
||||
return result
|
||||
|
|
@ -961,6 +963,9 @@ func (popup *popupData) setButtons(value any) bool {
|
|||
if button.OnClick != nil {
|
||||
result.onClick = newPopupListener1(button.OnClick)
|
||||
}
|
||||
if button.Binding != "" {
|
||||
result.onClick = newPopupListenerBinding(button.Binding, false)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue