mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-11 00:06:06 +00:00
fix: restore dialog focus using programmatic focus instead of autofocus
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
62fea97547
commit
aedf012c84
@@ -10,9 +10,11 @@
|
||||
} = $props();
|
||||
|
||||
let dialogEl: HTMLDialogElement;
|
||||
let confirmBtn: HTMLButtonElement;
|
||||
|
||||
$effect(() => {
|
||||
dialogEl?.showModal();
|
||||
confirmBtn?.focus();
|
||||
});
|
||||
|
||||
const btn = "px-3 py-1.5 rounded-md border border-edge bg-surface text-primary text-xs cursor-pointer hover:bg-hover";
|
||||
@@ -26,6 +28,7 @@
|
||||
<div class="flex justify-end gap-2">
|
||||
<button type="button" class={btn} onclick={oncancel} disabled={loading}>Cancel</button>
|
||||
<button
|
||||
bind:this={confirmBtn}
|
||||
type="submit"
|
||||
class="{btn} !text-white hover:!opacity-90 disabled:!opacity-50 disabled:!cursor-not-allowed flex items-center gap-1.5 {variant === 'accent' ? '!bg-accent !border-accent' : '!bg-danger !border-danger'}"
|
||||
disabled={loading}
|
||||
|
||||
@@ -8,9 +8,11 @@
|
||||
|
||||
let sshHost = $state(localStorage.getItem(STORAGE_KEY) ?? "");
|
||||
let dialogEl: HTMLDialogElement;
|
||||
let inputEl: HTMLInputElement;
|
||||
|
||||
$effect(() => {
|
||||
dialogEl?.showModal();
|
||||
inputEl?.focus();
|
||||
});
|
||||
|
||||
function handleSave() {
|
||||
@@ -34,6 +36,7 @@
|
||||
SSH Host <span class="opacity-60">(for "Open in Cursor")</span>
|
||||
</label>
|
||||
<input
|
||||
bind:this={inputEl}
|
||||
id="ssh-host"
|
||||
type="text"
|
||||
class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent"
|
||||
|
||||
Reference in New Issue
Block a user