fix: prevent autocomplete selection from submitting form#26646
fix: prevent autocomplete selection from submitting form#26646timja merged 10 commits intojenkinsci:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a UI regression where selecting an autocomplete suggestion could submit the enclosing configuration form, by suppressing default submit-related event behavior during suggestion selection.
Changes:
- Add
preventDefault()/stopPropagation()to autocomplete suggestion click handling. - Treat
EnterlikeTabin the autocomplete item key handler. - Modify/remove several tracked IntelliJ
.ideaproject files (icon/name/encodings).
Reviewed changes
Copilot reviewed 1 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/main/js/components/dropdowns/autocomplete.js | Prevents autocomplete item interactions from triggering form submission. |
| .idea/encodings.xml | Alters tracked IntelliJ encoding configuration (unrelated to the UI regression). |
| .idea/icon.svg | Removes tracked IntelliJ project icon (unrelated to the UI regression). |
| .idea/.name | Removes tracked IntelliJ project name (unrelated to the UI regression). |
Files not reviewed (2)
- .idea/.name: Language not supported
- .idea/encodings.xml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Do we know that this is a regression? Nothing in @daniel-beck's issue suggests it is, we normally just categorise it as a bug if-so. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
timja
left a comment
There was a problem hiding this comment.
Doesn't seem to work at all. PR description doesn't map to whats been committed at all
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 5 changed files in this pull request and generated 2 comments.
Files not reviewed (2)
- .idea/.name: Language not supported
- .idea/encodings.xml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry for the confusion, the description was outdated. The actual fix sets type="button" on all dropdown button elements in templates.js. I've updated the description to match what's been committed. |
There was a problem hiding this comment.
Sorry about that , I've restored the .idea files to their original state. The deletion was unintentional, caused by my local IntelliJ setup. They're back now and the PR only touches templates.js.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Other than the |
I've made the regression label red now so it stands out, missed that before. |
janfaracik
left a comment
There was a problem hiding this comment.
One comment - otherwise LGTM, thanks!
|
/label ready-for-merge This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
|
Congratulations on getting your very first Jenkins core pull request merged 🎉🥳 |
…6646) Co-authored-by: Jan Faracik <43062514+janfaracik@users.noreply.github.com>
Fixes #26639
Dropdown elements in the template lacked type="button", causing browsers to default them to type="submit" inside configuration forms. Clicking an autocomplete suggestion would therefore trigger an unintended form submission.
The fix sets type="button" at the template level in templates.js, covering all affected dropdowns globally — including the autocomplete and combo-box dropdowns mentioned in the issue.
Testing done
Manually tested in Firefox and Chrome by opening the Log Recorder configuration UI (/manage/log/), typing a partial value to trigger autocomplete, then selecting a suggestion via mouse click and Enter key. Verified the text field was populated and the form was not submitted. Also tested the "Build other projects" post-build action dropdown.
Screenshots (UI changes only)
Proposed changelog entries
Proposed changelog category
/label bug, web-ui
Proposed upgrade guidelines
N/A
Desired reviewers
@daniel-beck @timja