Skip to content

Commit

Permalink
LOYALIST-51 Use jQuery for required search invalid event
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmcd75 committed Aug 12, 2024
1 parent 660176b commit 4cd0844
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions custom/modules/loyalist_core/js/search_input_required.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
$(search_input).attr('required', true);
}

// If form validity check fails then apply BS5 invalid class.
document.getElementById("edit-fulltext").addEventListener("invalid",
function () {
$(this).addClass('is-invalid').attr('aria-invalid', 'true');
}
);

// If invalid event fires on search input then apply BS5 styling + ARIA.
$(search_input).on('invalid', function(event) {
$(this).addClass('is-invalid').attr('aria-invalid', 'true');
})
})(jQuery);

0 comments on commit 4cd0844

Please sign in to comment.