mirror of
https://github.com/bitwarden/android.git
synced 2026-10-22 19:13:34 -05:00
improved firstFocusedOrNull method
This commit is contained in:
1 file changed
+4
-4
@@ -353,10 +353,10 @@ private fun List<ViewNodeTraversalData>.selectCandidateAutofillViews(
|
||||
* if nothing is focused.
|
||||
*/
|
||||
private fun List<AutofillView>.firstFocusedOrNull(): AutofillView? {
|
||||
val focusedNonIdentity = firstOrNull { it.data.isFocused && it !is AutofillView.Identity }
|
||||
val focusedAny = firstOrNull { it.data.isFocused }
|
||||
val nonIdentity = firstOrNull { it !is AutofillView.Identity }
|
||||
return focusedNonIdentity ?: focusedAny ?: nonIdentity ?: firstOrNull()
|
||||
return this.firstOrNull { it.data.isFocused && it !is AutofillView.Identity }
|
||||
?: this.firstOrNull { it.data.isFocused }
|
||||
?: this.firstOrNull { it !is AutofillView.Identity }
|
||||
?: this.firstOrNull()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user