Skip to content

Commit

Permalink
keyCode -> key
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco committed Jan 13, 2025
1 parent f51274c commit 0a29c38
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
</form>
<script at="Foot">
$(function () {
const EscapeKeyCode = 27;
const EscapeKey = 'Escape';
var searchBox = $('#search-box');
// On each keypress filter the list of features
Expand All @@ -189,7 +189,7 @@
var elementsToFilter = $("[data-filter-value]");
// On ESC, clear the search box and display all features
if (e.keyCode == EscapeKeyCode || search == '') {
if (e.key == EscapeKey || search == '') {
searchBox.val('');
elementsToFilter.removeClass("d-none first-child-visible last-child-visible");
} else {
Expand Down Expand Up @@ -231,7 +231,7 @@
// this function will be executed on click of X (clear button)
searchBox.on('search', function () {
var e = $.Event('keyup');
e.keyCode= EscapeKeyCode;
e.key= EscapeKey;
searchBox.trigger(e);
});
Expand Down

0 comments on commit 0a29c38

Please sign in to comment.