[openstreetmap/openstreetmap-website] fix social links sub,mission (PR #6931)
DHARNEESH S L
notifications at github.com
Tue Mar 24 14:49:27 UTC 2026
### Description
Fixes #6903
When a user adds a social link, leaves the second input invalid, and then removes it, clicking "Update Profile" silently fails. The browser console shows:
```
The invalid form control with name='user[social_links_attributes][1][url]' is not focusable.
```
The browser's native HTML5 validation still holds a reference to the removed field, blocking form submission without any visible feedback to the user.
This fix ensures that when a social link input is removed, its validation constraints are cleared so the form can submit correctly.
### How has this been tested?
1. Visited Edit Profile → Links tab with no existing links
2. Added a valid URL (`https://example.com`) in the first input
3. Clicked "Add Social Link" — a second input appeared
4. Left the second input empty/invalid
5. Clicked "Remove" on the second input
6. Clicked "Update Profile" — form now submits successfully ✅
7. Verified the fix does not break the normal add/remove/submit flow
8. Ran the full test suite with `bundle exec rails test:all` — all tests pass
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/6931
-- Commit Summary --
* fix social links sub,mission
-- File Changes --
M app/assets/javascripts/user.js (7)
M test/system/profile_links_change_test.rb (24)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/6931.patch
https://github.com/openstreetmap/openstreetmap-website/pull/6931.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6931
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6931 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260324/dbc850a4/attachment.htm>
More information about the rails-dev
mailing list