diff --git a/src/components/search.svelte b/src/components/search.svelte index 15585c14..ad1559ff 100644 --- a/src/components/search.svelte +++ b/src/components/search.svelte @@ -6,9 +6,13 @@ export let placeholder: string = 'Search...'; export let clearSearch: () => void; import { X } from 'lucide-svelte'; + import { onMount } from 'svelte'; let inputElement; - + let isMac = true; + onMount(() => { + isMac = /(Macintosh|iPhone|iPod|iPad)/i.test(navigator.userAgent); + }); function focusInput(node: HTMLElement) { const handleKeydown = (event: KeyboardEvent) => { if ((event.metaKey || event.ctrlKey) && event.key === 'k') { @@ -66,11 +70,17 @@ {:else} -