Skip to content

Commit

Permalink
Add event listener for Enter pressed in the search field
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed Mar 15, 2021
1 parent a54e808 commit 97ebdaa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Resources/Public/Javascript/Search/SearchInDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,12 @@ function clearSearch() {
$('.results-active-indicator').remove();
$('#tx-dlf-search-in-document-query').val('');
}

$(document).ready(function() {
document.getElementById('tx-dlf-search-in-document-query').addEventListener("keydown", function (e) {
if (e.key === 'Enter') {
e.preventDefault();
search();
}
});
});

0 comments on commit 97ebdaa

Please sign in to comment.