mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 19:20:55 +00:00
Fixes for input autofocus, etc
This commit is contained in:
@ -27,16 +27,23 @@ function openSearchPanel() {
|
||||
|
||||
clearSearchResults();
|
||||
|
||||
// Finally, grab keyboard focus in the search bar
|
||||
panel.find('#search-input').focus();
|
||||
|
||||
panel.find('#search-input').on('keyup change', searchTextChanged);
|
||||
|
||||
// Callback for "clear search" button
|
||||
panel.find('#search-clear').click(function() {
|
||||
panel.find('#search-clear').click(function(event) {
|
||||
|
||||
// Prevent this button from actually submitting the form
|
||||
event.preventDefault();
|
||||
|
||||
panel.find('#search-input').val('');
|
||||
clearSearchResults();
|
||||
});
|
||||
|
||||
// Callback for the "close search" button
|
||||
panel.find('#search-close').click(function(event) {
|
||||
// Prevent this button from actually submitting the form
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
var searchRequests = [];
|
||||
@ -211,6 +218,9 @@ function clearSearchResults() {
|
||||
|
||||
// Delete any existing search results
|
||||
panel.find('#search-results').empty();
|
||||
|
||||
// Finally, grab keyboard focus in the search bar
|
||||
panel.find('#search-input').focus();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user