Bug fixing

This commit is contained in:
Alexei Anoshenko 2026-08-10 16:17:42 +03:00
parent 42067e1791
commit 03a1fd063a
1 changed files with 11 additions and 6 deletions

View File

@ -606,7 +606,7 @@ func (popup *popupData) Get(tag PropertyName) any {
return nil return nil
case Buttons: case Buttons:
if value := popup.getRaw(DismissEvent); value != nil { if value := popup.getRaw(Buttons); value != nil {
if buttons, ok := value.([]popupButton); ok { if buttons, ok := value.([]popupButton); ok {
result := make([]PopupButton, 0, len(buttons)) result := make([]PopupButton, 0, len(buttons))
for _, button := range buttons { for _, button := range buttons {
@ -614,12 +614,14 @@ func (popup *popupData) Get(tag PropertyName) any {
Title: button.title, Title: button.title,
Type: button.buttonType, Type: button.buttonType,
} }
switch listener := button.onClick.rawListener().(type) { if button.onClick != nil {
case string: switch listener := button.onClick.rawListener().(type) {
btn.Binding = listener case string:
btn.Binding = listener
case func(Popup): case func(Popup):
btn.OnClick = listener btn.OnClick = listener
}
} }
result = append(result, btn) result = append(result, btn)
} }
@ -961,6 +963,9 @@ func (popup *popupData) setButtons(value any) bool {
if button.OnClick != nil { if button.OnClick != nil {
result.onClick = newPopupListener1(button.OnClick) result.onClick = newPopupListener1(button.OnClick)
} }
if button.Binding != "" {
result.onClick = newPopupListenerBinding(button.Binding, false)
}
return result return result
} }