fix(composer): keep first focus on the expert menu when opening options

48d7526 widened the options dialog first-focus selector to inputs, so the new story graph switch above the menus took initial focus. Keyboard users no longer landed on the expert / work mode menus like the model picker. Restore the button-only target; the switch stays reachable with Tab.
This commit is contained in:
mesalogo
2026-10-03 20:04:55 +08:00
parent 942fe3206c
commit 2adee13638
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -333,7 +333,9 @@ export const Composer = memo(function Composer({
}
};
const frame = requestAnimationFrame(() => {
composerOptionsRef.current?.querySelector<HTMLElement>("input:not(:disabled), button:not(:disabled)")?.focus();
// Keyboard users land on the same first control as the model picker
// (expert / work mode menus); optional switches above stay Tab-reachable.
composerOptionsRef.current?.querySelector<HTMLButtonElement>("button:not(:disabled)")?.focus();
});
document.addEventListener("pointerdown", dismissOutside);
document.addEventListener("focusin", dismissOutside);