Skip to content

Commit

Permalink
fix: apply theme when setting theme
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Oct 24, 2023
1 parent b8a2ba8 commit a53c442
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions form.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,18 @@ func (f *Form) Theme(theme *Theme) *Form {
if theme != nil {
f.theme = theme
}

// NB: If dynamic forms come into play this will need to be applied when
// groups and fields are added.
for _, group := range f.groups {
group.Theme(f.theme)
group.KeyMap(f.keymap)
for _, field := range group.fields {
field.Theme(f.theme)
field.KeyMap(f.keymap)
}
}

return f
}

Expand Down

0 comments on commit a53c442

Please sign in to comment.