Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BpkAppSearchModal animation #1760

Merged
merged 4 commits into from
Oct 13, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
package net.skyscanner.backpack.compose.appsearchmodal

import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.AnnotatedString
import kotlinx.coroutines.launch
import net.skyscanner.backpack.compose.appsearchmodal.internal.BpkAppSearchModalImpl
import net.skyscanner.backpack.compose.icon.BpkIcon
import net.skyscanner.backpack.compose.modal.BpkModal
import net.skyscanner.backpack.compose.modal.BpkModalState
import net.skyscanner.backpack.compose.modal.rememberBpkModalState
import net.skyscanner.backpack.compose.navigationbar.NavIcon

Expand Down Expand Up @@ -71,15 +74,18 @@ fun BpkAppSearchModal(
onInputChanged: (String) -> Unit,
onClose: () -> Unit,
modifier: Modifier = Modifier,
state: BpkModalState = rememberBpkModalState(),
) {

val coroutineScope = rememberCoroutineScope()
BpkModal(
navIcon = NavIcon.Close(
contentDescription = closeAccessibilityLabel,
onClick = onClose,
onClick = {
coroutineScope.launch { state.hide() }
},
),
modifier = modifier,
state = rememberBpkModalState(),
state = state,
action = null,
title = title,
onDismiss = onClose,
Expand Down