loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add validations.required check to dropdown field (#24849)

If dropdown is marked as required, we should not provide the `remove`
button.
This will cause user may post empty value which seems like a bug.

Definition:

![image](https://github.com/go-gitea/gitea/assets/18380374/cf48b478-244e-44e0-9a0e-7a0f02bc471a)
Post request form:

![image](https://github.com/go-gitea/gitea/assets/18380374/31d6f823-835f-422a-879c-3b1e18950ac8)
Result:

![image](https://github.com/go-gitea/gitea/assets/18380374/a9944fe9-24d0-4776-9eec-d31b70144eb4)

authored by

yp05327 and committed by
GitHub
5c0745c0 81ce271f

+2
+2
templates/repo/issue/fields/dropdown.tmpl
··· 4 4 <div class="ui fluid selection dropdown {{if .item.Attributes.multiple}}multiple clearable{{end}}"> 5 5 <input type="hidden" name="form-field-{{.item.ID}}" value="0"> 6 6 {{svg "octicon-triangle-down" 14 "dropdown icon"}} 7 + {{if not .item.Validations.required}} 7 8 {{svg "octicon-x" 14 "remove icon"}} 9 + {{end}} 8 10 <div class="default text"></div> 9 11 <div class="menu"> 10 12 {{range $i, $opt := .item.Attributes.options}}