Skip to content

Commit 13dc7de

Browse files
committed
Add enter to submit advanced search modal
1 parent f4bd2a6 commit 13dc7de

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

resources/views/partials/bootstrap-table.blade.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,18 @@ class="form-control ${this.constants.classes.input}"
368368
_this.applyAdvancedSearch();
369369
});
370370
371+
// Let Enter keypresses reuse the same submit path so keyboard users can apply filters quickly.
372+
this.$toolbarModal.find('.toolbar-model-form')
373+
.off('keydown.snipeAdvancedSearch')
374+
.on('keydown.snipeAdvancedSearch', ':input', function (event) {
375+
if (event.key !== 'Enter' || $(event.target).is('textarea')) {
376+
return;
377+
}
378+
379+
event.preventDefault();
380+
$(this).closest('form').trigger('submit');
381+
});
382+
371383
this.initAdvancedSearchFooter();
372384
};
373385

0 commit comments

Comments
 (0)