Skip to content

Commit

Permalink
fix: don't submit the form on enter for open dropdowns
Browse files Browse the repository at this point in the history
When enter is used to select options in a dropdown that will stay open,
don't submit the form.
  • Loading branch information
adele-usdr committed Dec 8, 2023
1 parent ad6a2a6 commit fbe8b9e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/client/src/components/Modals/SearchPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,9 @@ export default {
onShown() {
this.initFormState();
},
async onEnter() {
if (this.saveEnabled) {
async onEnter(event) {
const enterInOpenDropdown = event.target.closest('.vs--open');
if (this.saveEnabled && !enterInOpenDropdown) {
await this.onSubmit();
}
},
Expand Down

0 comments on commit fbe8b9e

Please sign in to comment.