diff --git a/apps/content/src/browser/browser.ts b/apps/content/src/browser/browser.ts index 49cd7d2..2550675 100644 --- a/apps/content/src/browser/browser.ts +++ b/apps/content/src/browser/browser.ts @@ -7,6 +7,7 @@ import 'remixicon/fonts/remixicon.css' import '@shared/styles/window.css' import App from './Browser.svelte' +import './browser.css' import { initializeShortcuts } from './lib/shortcuts' import { initializeWindow } from './lib/window' import './lib/window/api' diff --git a/apps/content/src/browser/components/omnibox/Omnibox.svelte b/apps/content/src/browser/components/omnibox/Omnibox.svelte index 0d7897a..8cce5b6 100644 --- a/apps/content/src/browser/components/omnibox/Omnibox.svelte +++ b/apps/content/src/browser/components/omnibox/Omnibox.svelte @@ -20,6 +20,7 @@ let inputElement: HTMLInputElement let suggestions: Suggestion[] = [] let selectedSuggestion = 0 + let selectionChange = false $: focusedOmnibox = tab.focusedOmnibox $: uri = tab.uri @@ -73,13 +74,16 @@ bind:value={inputContent} on:focusin={() => { focusedOmnibox.set(true) + selectionChange = false generateSuggestions() }} - on:blur|capture={() => - setTimeout(() => { - focusedOmnibox.set(false) - suggestions = [] - }, 100)} + on:blur|capture={() => setTimeout(() => focusedOmnibox.set(false), 100)} + on:mouseup={(_) => { + if (!selectionChange) inputElement.select() + }} + on:selectionchange={() => { + selectionChange = true + }} on:keyup={async (e) => { if (e.key === 'Enter') { focusedOmnibox.set(false) @@ -119,8 +123,8 @@