From a68b8027b17a9d0db95ed62470b0d0c61ebcfd34 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 27 May 2025 18:44:01 +0200 Subject: [PATCH] Improve command center search and layout styling Replace HTML autofocus attribute with custom Svelte action to avoid a11y warnings. Fix option layout direction from column to row and update search input padding/margin values. --- src/lib/commandCenter/panels/template.svelte | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/lib/commandCenter/panels/template.svelte b/src/lib/commandCenter/panels/template.svelte index 78dc3fe74..4065c0421 100644 --- a/src/lib/commandCenter/panels/template.svelte +++ b/src/lib/commandCenter/panels/template.svelte @@ -11,6 +11,7 @@ import { IconArrowSmRight } from '@appwrite.io/pink-icons-svelte'; import { Icon, Keyboard, Layout } from '@appwrite.io/pink-svelte'; import { Submit, trackEvent } from '$lib/actions/analytics'; + import type { Action } from 'svelte/action'; /* eslint no-undef: "off" */ type Option = $$Generic & { group?: string }>; @@ -247,6 +248,10 @@ return isGroup(nextItem) || !nextItem?.nested; }; + + const autofocus: Action = (node) => { + if (node) node.focus(); + }; @@ -271,8 +276,11 @@ @@ -305,7 +313,7 @@ on:mouseleave={getOptionBlurHandler()} on:focus={getOptionFocusHandler(item)}> - + {#if item.icon}