Updated on 2026-08-14

This commit is contained in:
Tangem 2026-07-14 12:15:29 +03:00
parent e0feda9a00
commit fda7f64fd9

View file

@ -9,7 +9,7 @@ import androidx.compose.ui.test.assertIsDisplayed
/** Returns the first non-blank text found in this node or its subtree (unmerged tree). */ /** Returns the first non-blank text found in this node or its subtree (unmerged tree). */
fun SemanticsNode.firstTextOrNull(): String? { fun SemanticsNode.firstTextOrNull(): String? {
config.getOrNull(SemanticsProperties.Text) config.getOrNull(SemanticsProperties.Text)
?.firstOrNull()?.text?.toString()?.takeIf { it.isNotBlank() } ?.firstOrNull()?.text?.takeIf { it.isNotBlank() }
?.let { return it } ?.let { return it }
children.forEach { child -> child.firstTextOrNull()?.let { return it } } children.forEach { child -> child.firstTextOrNull()?.let { return it } }
return null return null