Preserve native Enter activation on dictation language options

This commit is contained in:
amosblomqvist
2026-10-27 22:01:16 +02:00
parent fbafc5e53a
commit f5a655b2f9
2 changed files with 27 additions and 1 deletions
+6 -1
View File
@@ -86,7 +86,12 @@ function DictationLanguagePicker({ preference, disabled }: {
>
<div onKeyDown={(event) => {
closeOnEscape(event);
if (event.key === "Enter") { event.preventDefault(); event.stopPropagation(); }
if (event.key === "Enter") {
// Empty search results must not submit the composer, but a
// focused option button still needs Enter's native click.
if (event.target instanceof HTMLInputElement) event.preventDefault();
event.stopPropagation();
}
}}>
{error && <div role="alert" className="mb-1.5 text-destructive">{error}</div>}
<SearchMenuList