From 0bce959d34584d479d1a026f4e19cac29d3889eb Mon Sep 17 00:00:00 2001 From: PJ Date: Sun, 26 Apr 2026 23:57:01 +0700 Subject: [PATCH] refactor(folio-spec): use element.id for focused field tag Now that ResourceID populates uniformly across Android/iOS Compose, the spec can read element.id directly instead of probing attrs for each platform's underlying field name. --- examples/folio/sanderling/spec.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/examples/folio/sanderling/spec.ts b/examples/folio/sanderling/spec.ts index 2f15654..f112e87 100644 --- a/examples/folio/sanderling/spec.ts +++ b/examples/folio/sanderling/spec.ts @@ -64,13 +64,7 @@ const ledgerRows = extract(s => { const ledgerBalance = extract(s => parseDollarCents(s.ax.find({ testTag: "LedgerBalance" })?.text)); -// Focus uses the native focused="true" attribute. We surface whichever -// stable identifier the focused element carries (testTag, label, etc). -const focusedFieldTag = extract(s => { - const f = s.ax.find({ focused: "true" }); - if (!f) return null; - return f.attrs?.["resource-id"] ?? f.attrs?.["accessibilityIdentifier"] ?? f.attrs?.["identifier"] ?? null; -}); +const focusedFieldTag = extract(s => s.ax.find({ focused: "true" })?.id ?? null); const loginEmailField = extract(s => s.ax.find({ testTag: "LoginScreen" })?.find({ testTag: "LoginEmail" }));