mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-21 20:24:02 +00:00
fix(ui): skip hidden global search results in keyboard nav
Limit navigateResults to visible .search-result-item nodes under the search root so hidden command palette entries are not focused.
This commit is contained in:
@@ -134,7 +134,8 @@
|
||||
});
|
||||
},
|
||||
navigateResults(direction) {
|
||||
const results = document.querySelectorAll('.search-result-item');
|
||||
const results = Array.from(this.$el.querySelectorAll('.search-result-item'))
|
||||
.filter(item => item.offsetParent !== null);
|
||||
if (results.length === 0) return;
|
||||
|
||||
if (direction === 'down') {
|
||||
|
||||
@@ -25,3 +25,10 @@ it('uses a single Alpine result renderer for every command palette result type',
|
||||
->toContain('x-for="(result, index) in searchResults"')
|
||||
->toContain('x-for="[categoryName, items] in Object.entries(groupedCreatableItems)"');
|
||||
});
|
||||
|
||||
it('skips hidden command palette results during keyboard navigation', function () {
|
||||
$view = file_get_contents(resource_path('views/livewire/global-search.blade.php'));
|
||||
|
||||
expect($view)
|
||||
->toContain('filter(item => item.offsetParent !== null)');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user