mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-03 03:27:10 +00:00
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.
This commit is contained in:
1 parent
139ca958f6
commit
0bce959d34
1 file changed
+1
-7
@@ -64,13 +64,7 @@ const ledgerRows = extract<LedgerRow[]>(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" }));
|
||||
|
||||
Reference in new issue
Block a user