mirror of
https://github.com/aljazceru/awesome-nostr.git
synced 2026-10-05 11:28:22 +00:00
Merge pull request #729 from dajiaohuang/fix-search-clear-restore
fix: restore the section view when the search box is cleared
This commit is contained in:
@@ -496,7 +496,9 @@ searchInput.addEventListener('input', (e) => {
|
|||||||
|
|
||||||
if (!searchTerm) {
|
if (!searchTerm) {
|
||||||
// If search is empty, restore current category view
|
// If search is empty, restore current category view
|
||||||
const currentCategory = document.querySelector('.nav-links a.active')?.textContent;
|
// (the nav link's textContent carries the icon markup's whitespace,
|
||||||
|
// so it must be trimmed to match the keys in window.parsedResources)
|
||||||
|
const currentCategory = document.querySelector('.nav-links a.active')?.textContent.trim();
|
||||||
if (currentCategory) {
|
if (currentCategory) {
|
||||||
displaySection(currentCategory, window.parsedResources);
|
displaySection(currentCategory, window.parsedResources);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user