Skip to content

Commit

Permalink
Merge pull request #957 from fmuttis/main
Browse files Browse the repository at this point in the history
When there is no value on an input, favor HTML's placeholder instead of katana's
  • Loading branch information
Mzack9999 authored Aug 20, 2024
2 parents 2cfa579 + b60ab88 commit 091ed54
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/utils/formfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func FormInputFillSuggestions(inputs []FormInput) mapsutil.OrderedMap[string, st
data := mapsutil.NewOrderedMap[string, string]()

// Fill checkboxes and radioboxes first or default values first
for _, input := range inputs {
for i, input := range inputs {
switch input.Type {
case "radio":
// Use a single radio name per value
Expand All @@ -81,6 +81,9 @@ func FormInputFillSuggestions(inputs []FormInput) mapsutil.OrderedMap[string, st
// infer the values based on input types.
if input.Value != "" {
data.Set(input.Name, input.Value)
} else if value, ok := input.Attributes.Get("placeholder"); ok {
inputs[i].Value = value
data.Set(input.Name, value)
}
}
}
Expand Down

0 comments on commit 091ed54

Please sign in to comment.