An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix(ui): skip hidden global search results in keyboard nav
Andras Bacsaia37f1369c80c
diff --git a/resources/views/livewire/global-search.blade.php b/resources/views/livewire/global-search.blade.phpindex 2c12f72ddf..f3c73770d6 100644--- a/resources/views/livewire/global-search.blade.php+++ b/resources/views/livewire/global-search.blade.php@@ -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') {diff --git a/tests/Feature/GlobalSearchLoadingStateTest.php b/tests/Feature/GlobalSearchLoadingStateTest.phpindex 82a3237b6f..929f75f38a 100644--- a/tests/Feature/GlobalSearchLoadingStateTest.php+++ b/tests/Feature/GlobalSearchLoadingStateTest.php@@ -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)');+});