[ui] DomiUi: @domi/ui v1.2.0; on Android the town field is an editable box, so focusing it sends no Autofill request (TextField as=auto)

This commit is contained in:
2026-11-23 01:34:49 +01:00
parent 8018268821
commit 7f8b6861f9
17 changed files with 312 additions and 28 deletions
+8 -2
View File
@@ -30,6 +30,8 @@
// Raw: the towns are handed on as they came, never wrapped in a state Proxy.
let results = $state.raw<readonly NamedPlace[]>([]);
let input = $state<HTMLInputElement | HTMLTextAreaElement | null>(null);
// On Android the field is an editable box, not an <input> (as="auto" below): focus whichever there is.
let editor = $state<HTMLElement | null>(null);
// Only the latest query's answer is shown, however the searches finish.
let asked = 0;
@@ -52,7 +54,7 @@
});
$effect(() => {
if (focusOnOpen) input?.focus();
if (focusOnOpen) (input ?? editor)?.focus();
});
const where = (t: NamedPlace): string => [t.region, t.country].filter(Boolean).join(', ');
@@ -63,8 +65,11 @@
<p class="why">{en.sunset.why}</p>
<!-- The list already follows the typing; the seal and Enter only confirm it, so they say nothing of their own
(sentText) and the status line below speaks (domi-ui.md D4). Nothing is sent anywhere: "search", never "send". -->
(sentText) and the status line below speaks (domi-ui.md D4). Nothing is sent anywhere: "search", never "send".
as="auto": on Android an editable box, because a native field makes the WebView ask Google's Autofill service
the moment it gets focus, whatever the app's permissions (domi-ui.md D10). -->
<TextField
as="auto"
id="{uid}-search"
type="search"
label={en.sunset.searchLabel}
@@ -76,6 +81,7 @@
onsend={() => {}}
bind:value={query}
bind:input
bind:editor
/>
<p class="found" role="status" aria-live="polite">{query.trim() === '' ? '' : en.sunset.found(results.length)}</p>