Archived
Focus project path input on add dialog
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user