Skip to content

Commit

Permalink
Merge pull request #989 from rsteube/actionvalues-skip-empty
Browse files Browse the repository at this point in the history
ActionValues: skip empty
  • Loading branch information
rsteube authored Feb 13, 2024
2 parents a75eef1 + bbe87bf commit d3f0050
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion defaultActions.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ func ActionValues(values ...string) Action {
return ActionCallback(func(c Context) Action {
vals := make([]common.RawValue, 0, len(values))
for _, val := range values {
vals = append(vals, common.RawValue{Value: val, Display: val})
if val != "" {
vals = append(vals, common.RawValue{Value: val, Display: val})
}
}
return Action{rawValues: vals}
})
Expand Down

0 comments on commit d3f0050

Please sign in to comment.