Merge branch 'MDL-78944-42' of https://github.com/Chocolate-lightning/moodle into MOODLE_402_STABLE

This commit is contained in:
Sara Arjona
2024-02-21 09:19:06 +01:00
3 changed files with 13 additions and 4 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+11 -2
View File
@@ -242,6 +242,11 @@ export default class ColumnSearch extends GradebookSearchClass {
registerInputEvents() {
// Register & handle the text input.
this.searchInput.addEventListener('input', debounce(async() => {
if (this.getSearchTerm() === this.searchInput.value && this.searchResultsVisible()) {
window.console.warn(`Search term matches input value - skipping`);
// Debounce can happen multiple times quickly.
return;
}
this.setSearchTerms(this.searchInput.value);
// We can also require a set amount of input before search.
if (this.searchInput.value === '') {
@@ -251,9 +256,13 @@ export default class ColumnSearch extends GradebookSearchClass {
// Display the "clear" search button in the search bar.
this.clearSearchButton.classList.remove('d-none');
}
const pendingPromise = new Pending();
// User has given something for us to filter against.
await this.filterrenderpipe();
}, 300));
await this.filterrenderpipe().then(() => {
pendingPromise.resolve();
return true;
});
}, 300, {pending: true}));
}
/**