Browse Source

Merge pull request #2381 from element-hq/feature/bma/pollKeyboard

Open the keyboard (and keep it opened) when creating a poll.
pull/2385/head
Benoit Marty 7 months ago committed by GitHub
parent
commit
896bd4126e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      changelog.d/2329.bugfix
  2. 16
      features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesView.kt

1
changelog.d/2329.bugfix

@ -0,0 +1 @@ @@ -0,0 +1 @@
Open the keyboard (and keep it opened) when creating a poll.

16
features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesView.kt

@ -39,7 +39,6 @@ import androidx.compose.material3.ButtonDefaults @@ -39,7 +39,6 @@ import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
@ -194,7 +193,12 @@ fun MessagesView( @@ -194,7 +193,12 @@ fun MessagesView(
roomName = state.roomName.dataOrNull(),
roomAvatar = state.roomAvatar.dataOrNull(),
callState = state.callState,
onBackPressed = onBackPressed,
onBackPressed = {
// Since the textfield is now based on an Android view, this is no longer done automatically.
// We need to hide the keyboard when navigating out of this screen.
localView.hideKeyboard()
onBackPressed()
},
onRoomDetailsClicked = onRoomDetailsClicked,
onJoinCallClicked = onJoinCallClicked,
)
@ -260,14 +264,6 @@ fun MessagesView( @@ -260,14 +264,6 @@ fun MessagesView(
onUserDataClicked = onUserDataClicked,
)
ReinviteDialog(state = state)
// Since the textfield is now based on an Android view, this is no longer done automatically.
// We need to hide the keyboard automatically when navigating out of this screen.
DisposableEffect(Unit) {
onDispose {
localView.hideKeyboard()
}
}
}
@Composable

Loading…
Cancel
Save