diff --git a/src/client/src/components/ProjectDialog.ts b/src/client/src/components/ProjectDialog.ts index 197209d..8a034ae 100644 --- a/src/client/src/components/ProjectDialog.ts +++ b/src/client/src/components/ProjectDialog.ts @@ -1,5 +1,5 @@ import { LitElement, html } from "lit"; -import { customElement, property, state } from "lit/decorators.js"; +import { customElement, property, query, state } from "lit/decorators.js"; import { api, type FileSuggestion } from "../api"; import { css } from "lit"; @@ -12,6 +12,7 @@ export class ProjectDialog extends LitElement { @state() private suggestions: FileSuggestion[] = []; @state() private selected = 0; @state() private loading = false; + @query("input") private pathInput?: HTMLInputElement; private requestId = 0; @@ -20,6 +21,10 @@ export class ProjectDialog extends LitElement { void this.loadSuggestions(); } + override firstUpdated(): void { + this.pathInput?.focus(); + } + private async loadSuggestions() { const requestId = ++this.requestId; this.loading = true;