Clear the Add Location form after each add #207
No reviewers
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
security
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot!207
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/location-form-reset"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reported by @rbrooks on dev (rc5), 2026-10-13, while adding three locations in a row: the name box was blank for the first, then held the previous location's name each time after, and the minimum severity did not reset either.
Cause
submitAddLocationcloses the dialog and callswindow.location.reload()on success. Browsers restore form field values across a reload, so the form reopened with the last submission's name, severity, search text and coordinates.It is worse than cosmetic: the search box only auto-fills the name when the name field is blank, so with a leftover name the pin moves to the new place while the name stays the old one. A second location can be saved under the first one's name.
Fix
resetAddLocationForm()runs before the reload:form.reset(), hides the error, removes the map pin and returns the map to the national view.autocomplete="off"so the browser does not restore it.autocomplete="off"too.Verification
Ships in v2.0.0-rc6.
🤖 Generated with Claude Code