2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/23138 - Close recently visited menu on orientation change

This commit is contained in:
Sarah Khan 2022-01-14 19:48:20 +05:30 committed by mergify[bot]
parent 4cc2e61f8e
commit 5a86929bf5

View File

@ -32,12 +32,14 @@ import androidx.compose.material.DropdownMenu
import androidx.compose.material.DropdownMenuItem
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextOverflow
@ -306,6 +308,10 @@ private fun RecentlyVisitedMenu(
recentVisit: RecentlyVisitedItem,
onDismissRequest: () -> Unit,
) {
DisposableEffect(LocalConfiguration.current.orientation) {
onDispose { onDismissRequest() }
}
DropdownMenu(
expanded = showMenu,
onDismissRequest = { onDismissRequest() },