Return oversized BIV if no BIV is within the viewport size

When finding the next BIV request, if there is a request
that is oversized, the algorithm returns the largest BIV
that fit in the viewport.
However, if there are no BIV requests smaller than the
viewport, the oversized BIVs are ignored, causing scroll
to fail.
Updating code to return the smallest oversized BIV request
if all requests are oversized.

Test: Fixes failing test.
Fixes: 278219642

Change-Id: I53af354b01b82eaba246ec4e96cc61e93ed20eb5
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/ContentInViewNode.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/ContentInViewNode.kt
index 40edcad..1efe022 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/ContentInViewNode.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/ContentInViewNode.kt
@@ -328,7 +328,9 @@
                 // TODO(klippenstein) if there is a request that's too big to fit in the current
                 //  bounds, we should try to fit the largest part of it that contains the
                 //  next-smallest request.
-                return rectangleToMakeVisible
+                // if rectangleToMakeVisible is null, return the current bounds even if it is
+                // oversized.
+                return rectangleToMakeVisible ?: bounds
             }
         }
         return rectangleToMakeVisible
diff --git a/tv/tv-foundation/src/androidTest/java/androidx/tv/foundation/lazy/list/LazyRowTest.kt b/tv/tv-foundation/src/androidTest/java/androidx/tv/foundation/lazy/list/LazyRowTest.kt
index bb040c9..0817a21 100644
--- a/tv/tv-foundation/src/androidTest/java/androidx/tv/foundation/lazy/list/LazyRowTest.kt
+++ b/tv/tv-foundation/src/androidTest/java/androidx/tv/foundation/lazy/list/LazyRowTest.kt
@@ -39,7 +39,6 @@
 import androidx.tv.foundation.PivotOffsets
 import androidx.tv.foundation.lazy.grid.keyPress
 import com.google.common.truth.Truth.assertThat
-import org.junit.Ignore
 import org.junit.Rule
 import org.junit.Test
 import org.junit.runner.RunWith
@@ -121,7 +120,6 @@
             .assertPositionInRootIsEqualTo(50.dp, 30.dp)
     }
 
-    @Ignore("b/278219642")
     @Test
     fun scrollsLeftInRtl() {
         lateinit var state: TvLazyListState