A bug has been reported where submitting the user preferences form by pressing ‘Enter’ causes a native form submission, resulting in a GET request and page reload without saving changes. manut initially reported the issue on main Discourse, reproducing it in Firefox ESR and Chromium with a clean profile. chapoi could not reproduce it on Meta, prompting further investigation. JammyDodger confirmed the bug on Meta in both Firefox and Chrome, noting the URL briefly appends a ‘?’ on reload. sam confirmed it’s reproducible in a clean dev environment and suggested a fix by preventing the default form submission behavior in the preferences.js controller. manut clarified that the issue occurs even with plugins disabled, confirming it’s not a browser extension interference.
It is 100% reproducable in a clean dv environment.
On Chrome latest:
dv new enter-submit http://enter-submit.localhost/session/user1/become
visit http://enter-submit.localhost/u/user1/preferences/account
change name
click enter
Page reloads.
How are we feeling about something like this @martin / @j.jaffeux in /frontend/discourse/app/controllers/preferences.js: