SearchBar handle the back press when it is active, there is no need to handle the event here.

This commit is contained in:
Benoit Marty
2024-04-05 09:23:36 +02:00
parent fcc02f323c
commit 0af235d50d

View File

@@ -83,12 +83,8 @@ fun ChangeRolesView(
modifier: Modifier = Modifier,
) {
val updatedOnBackPressed by rememberUpdatedState(newValue = onBackPressed)
BackHandler {
if (state.isSearchActive) {
state.eventSink(ChangeRolesEvent.ToggleSearchActive)
} else {
state.eventSink(ChangeRolesEvent.Exit)
}
BackHandler(enabled = !state.isSearchActive) {
state.eventSink(ChangeRolesEvent.Exit)
}
Box(modifier = modifier) {