Status Update
Comments
nj...@google.com <nj...@google.com>
il...@google.com <il...@google.com>
va...@google.com <va...@google.com> #2
Which API level are you seeing the issue here with?
va...@google.com <va...@google.com> #3
My hunch is that this is related to DialogFragment
or ComponentDialog
adds a new Window
that the contained ComposeView
is not aware of.
al...@hu.ma <al...@hu.ma> #4
I've only tested this on API level 33 and 26 so far, and out of these two I'm seeing this only on 33
yu...@gmail.com <yu...@gmail.com> #5
Hello,
We're also experiencing this issue starting from compose 1.4.0-alpha03 and API level >= 30.
Attaching min repro project. Similar issue was filed in Aug 25, 2021 here
te...@gmail.com <te...@gmail.com> #6
Experiencing the same issue. Slowly migrating the project to compose and i still need the some compose views to be inside a DialogFragment.
cj...@gmail.com <cj...@gmail.com> #7
Faced the same and like #3 mentioned, compose switched to use a DialogWindowProvider
to figure out its window.
To workaround it in the meantime I copied ComposeView and made it report my dialog window. Not easy, but you cant get past creating a subclass.
internal abstract class ComposeBottomSheetFragment : BottomSheetDialogFragment() { // Can be simple DialogFragment
@Composable protected abstract fun Content()
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return ComposeDialogView(requireContext()).also {
it.consumeWindowInsets = false
it.layoutParams = LayoutParams(MATCH_PARENT, WRAP_CONTENT)
it.setContent {
OurTheme { Content() }
}
}
}
// Copy of ComposeView that is able to supply the dialog window to compose.
// I used inner class but you can also pass a lambda to the view and lazily request the window
inner class ComposeDialogView(context: Context) : AbstractComposeView(context, null, 0), DialogWindowProvider {
// The important bit
override val window get() = requireDialog().window!!
private val content = mutableStateOf<(@Composable () -> Unit)?>(null)
override var shouldCreateCompositionOnAttachedToWindow: Boolean = false
private set
@Composable
override fun Content() {
content.value?.invoke()
}
override fun getAccessibilityClassName(): CharSequence = ComposeView::class.java.name
/**
* Set the Jetpack Compose UI content for this view.
* Initial composition will occur when the view becomes attached to a window or when
* [createComposition] is called, whichever comes first.
*/
fun setContent(content: @Composable () -> Unit) {
shouldCreateCompositionOnAttachedToWindow = true
this.content.value = content
if (isAttachedToWindow) createComposition()
}
}
private var ComposeDialogView.consumeWindowInsets: Boolean
get() = getTag(androidx.compose.ui.R.id.consume_window_insets_tag) as? Boolean ?: true
set(value) {
setTag(androidx.compose.ui.R.id.consume_window_insets_tag, value)
}
}
va...@google.com <va...@google.com> #8
That workaround should work, due to this line:
Only seeing this issue on API 30 and above also makes sense, due to the underlying mechanics.
go...@gmail.com <go...@gmail.com> #9
I tested with the stable 1.4.0 version, having the same problem.
ae...@google.com <ae...@google.com>
ra...@gmail.com <ra...@gmail.com> #11
override val window by lazy {
requireDialog().window!!
}
ca...@sitoo.com <ca...@sitoo.com> #12
It looks like in my case that it tries to fetch the window to close the soft keyboard after the dialog window has disappeared
java.lang.NullPointerException
at com.xyz.compose.ComposeDialogFragment$windowProvider$2$1.getWindow(ComposeFragment.kt:101)
at com.xyz.compose.ComposeDialogFragment$ComposeDialogView.getWindow(Unknown Source:2)
at androidx.compose.ui.text.input.ImmHelper30.findWindow(InputMethodManager.kt:159)
at androidx.compose.ui.text.input.ImmHelper30.getInsetsControllerCompat(InputMethodManager.kt:133)
at androidx.compose.ui.text.input.ImmHelper30.hideSoftInput(InputMethodManager.kt:152)
at androidx.compose.ui.text.input.InputMethodManagerImpl.hideSoftInput(InputMethodManager.kt:83)
at androidx.compose.ui.text.input.TextInputServiceAndroid.setKeyboardVisibleImmediately(TextInputServiceAndroid.android.kt:397)
at androidx.compose.ui.text.input.TextInputServiceAndroid.processInputCommands(TextInputServiceAndroid.android.kt:302)
at androidx.compose.ui.text.input.TextInputServiceAndroid.sendInputCommand$lambda$1(TextInputServiceAndroid.android.kt:209)
at androidx.compose.ui.text.input.TextInputServiceAndroid.$r8$lambda$tFIm8sXGny3G873nGUe23EJe7OY(Unknown Source:0)
at androidx.compose.ui.text.input.TextInputServiceAndroid$$ExternalSyntheticLambda0.run(Unknown Source:2)
at androidx.compose.ui.text.input.TextInputServiceAndroid_androidKt.asExecutor$lambda$1$lambda$0(TextInputServiceAndroid.android.kt:504)
at androidx.compose.ui.text.input.TextInputServiceAndroid_androidKt.$r8$lambda$RYljF3nl5HRu6JKEM8xFRHwbGFg(Unknown Source:0)
at androidx.compose.ui.text.input.TextInputServiceAndroid_androidKt$$ExternalSyntheticLambda0.doFrame(Unknown Source:2)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1229)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
at android.view.Choreographer.doCallbacks(Choreographer.java:899)
at android.view.Choreographer.doFrame(Choreographer.java:827)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
en...@gmail.com <en...@gmail.com> #13
Any progress on this issue? Seems like it breaks a lot of things, I can't migrate to 1.4
kl...@google.com <kl...@google.com>
ap...@google.com <ap...@google.com> #14
Branch: androidx-main
commit 1763fd0e7b7e11e0ac928762c2c6d16f0c049762
Author: Zach Klippenstein <klippenstein@google.com>
Date: Thu Apr 13 14:34:16 2023
Fix keyboard not showing when text field is in non-Compose dialog.
Fixes:
Test: TextFieldFocusCustomDialogTest
Relnote: "Fixed regression where keyboard wasn't showing for text fields
inside dialogs not created by the `Dialog` composable."
Change-Id: I825512cde7e41dadfc8b7491bd24190d21b14729
M compose/foundation/foundation/build.gradle
M compose/foundation/foundation/src/androidAndroidTest/AndroidManifest.xml
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldFocusCustomDialogTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/InputMethodManager.kt
ch...@gmail.com <ch...@gmail.com> #15
There is any plan about which version is the bug fix planned to be released in?
ch...@gmail.com <ch...@gmail.com> #17
Thanks for the explanation, so the BOM versions will also be updated within a month (like 2023.04.xx)? If so, that will be great!
pr...@google.com <pr...@google.com> #18
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.4.2
androidx.compose.ui:ui:1.4.2
ap...@google.com <ap...@google.com> #19
Branch: androidx-main
commit 7545cec3617ab5d1ea83d66822bc094e7f03c562
Author: José Figueroa Santos <serniebanders@google.com>
Date: Wed Apr 19 16:04:18 2023
[Material3][gradle] Update compose dependencies to 1.4.2
Upgrade needed to intake the following bug fix:
Bug: 268380384
Bug: 272483584
RelNote: ModalBottomSheet now can display IME keyboard
Test: Manual
Change-Id: Idc5082008acb547cac2100a69cab4be7db85f50f
M compose/material3/material3/build.gradle
M compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/BottomSheetSamples.kt
ed...@gmail.com <ed...@gmail.com> #20
I am using compose and my dependencies are as follows:
def composeBom = platform('androidx.compose:compose-bom:2023.01.00')
implementation composeBom
androidTestImplementation composeBom
// Material Design 3
implementation "androidx.compose.material3:material3:$compose_material3_version"
implementation "androidx.compose.material3:material3-window-size-class:$compose_material3_version"
implementation 'androidx.compose.ui:ui:1.5.0-alpha03'.
Once I hide the modal bottom sheet, only then does the keyboard shows up. Strange
an...@favordelivery.com <an...@favordelivery.com> #21
sh...@venturedive.com <sh...@venturedive.com> #22
st...@google.com <st...@google.com> #23
As per
ed...@gmail.com <ed...@gmail.com> #24
an...@gmail.com <an...@gmail.com> #26
Such a serious bug and nobody pays normal attention to it.
there is a hack described in this post
for now I use this approach, but I really hope that someone from Google will eventually fix this frustrating bug.
ja...@gmail.com <ja...@gmail.com> #27
Hi,
keyboard was shown properly in compose 1.4.3 but in 1.5.0-alpha03 it stopped working again.
In 1.4.3 and 1.5.0-alpha03 now i have following issue which causing app crash.
1 @main: CRASH DETECTED on thread Thread[main,5,main]
E java.lang.IllegalStateException: LayoutCoordinate operations are only valid when isAttached is true
E at androidx.compose.ui.node.NodeCoordinator.localToRoot-MK-Hz9U(NodeCoordinator.kt:850)
E at androidx.compose.foundation.text.TextFieldDelegate$Companion.notifyFocusedRect$foundation_release(TextFieldDelegate.kt:173)
E at androidx.compose.foundation.text.CoreTextFieldKt.notifyFocusedRect(CoreTextField.kt:1111)
E at androidx.compose.foundation.text.CoreTextFieldKt.notifyTextInputServiceOnFocusChange(CoreTextField.kt:962)
E at androidx.compose.foundation.text.CoreTextFieldKt.access$notifyTextInputServiceOnFocusChange(CoreTextField.kt:1)
E at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$focusModifier$1.invoke(CoreTextField.kt:293)
E at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$focusModifier$1.invoke(CoreTextField.kt:282)
E at androidx.compose.ui.focus.FocusChangedModifierNode.onFocusEvent(FocusChangedModifier.kt:59)
E at androidx.compose.ui.focus.FocusEventModifierNodeKt.refreshFocusEventNodes(FocusEventModifierNode.kt:68)
E at androidx.compose.ui.focus.FocusTransactionsKt.requestFocusForChild(FocusTransactions.kt:208)
E at androidx.compose.ui.focus.FocusTransactionsKt.performRequestFocus(FocusTransactions.kt:69)
E at androidx.compose.ui.focus.FocusTransactionsKt.requestFocus(FocusTransactions.kt:44)
E at androidx.compose.ui.focus.FocusRequester.focus$ui_release(FocusRequester.kt:72)
E at androidx.compose.ui.focus.FocusRequester.requestFocus(FocusRequester.kt:63)
E at androidx.compose.foundation.text.CoreTextFieldKt.tapToFocus(CoreTextField.kt:939)
E at androidx.compose.foundation.text.CoreTextFieldKt.access$tapToFocus(CoreTextField.kt:1)
E at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke-k-4lQ0M(CoreTextField.kt:342)
E at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke(CoreTextField.kt:341)
E at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke-k-4lQ0M(TextFieldPressGestureFilter.kt:81)
E at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke(TextFieldPressGestureFilter.kt:54)
E at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1.invokeSuspend(TapGestureDetector.kt:255)
E at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
E at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
E at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
E at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
E at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
E at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
E at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
E at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:672)
E at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl.dispatchPointerEvent(SuspendingPointerInputFilter.kt:548)
E at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:570)
E at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:314)
E at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
E at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
E at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
E at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
E at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
E at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:183)
E at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:102)
E at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:98)
E at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1371)
E at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1323)
E at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1263)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:500)
E at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1905)
E at android.app.Dialog.dispatchTouchEvent(Dialog.java:911)
E at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70)
E at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:458)
E at android.view.View.dispatchPointerEvent(View.java:15262)
E at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6654)
E at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6454)
E at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5910)
E at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5967)
E at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5933)
E at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6098)
E at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5941)
E at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6155)
E at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5914)
E at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5967)
E at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5933)
E at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5941)
E at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5914)
E at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8996)
E at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8947)
E at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8916)
E at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9119)
E at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:267)
E at android.os.MessageQueue.nativePollOnce(Native Method)
E at android.os.MessageQueue.next(MessageQueue.java:335)
E at android.os.Looper.loopOnce(Looper.java:161)
E at android.os.Looper.loop(Looper.java:288)
E at android.app.ActivityThread.main(ActivityThread.java:7872)
E at java.lang.reflect.Method.invoke(Native Method)
E at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@a05fbf2, androidx.compose.runtime.BroadcastFrameClock@67c3243, StandaloneCoroutine{Cancelling}@d0400c0, AndroidUiDispatcher@76f01f9]
Steps to reproduce should be quite simple. Just create some BottomSheetDialogFragment which will have compose view inside and in that compose view you should have some TextInputs. Also im using FocusRequester in that compose screen.
In compose 1.4.3 - keyboard was shown properly when i clicked into text inputs there BUT if i clicked on some input which was partially hidden under keyboard it caused crash (see stacktrace above). In compose 1.5.0-alpha03 - keyboard is not showing when i clicked into some text input - instead it will just do that crash (see stacktrace above).
This issue occur on Samsung S23 and also on emulator.
I think its related to
Please act urgently and increase this ticket priority because its important issue. Thanks
ed...@gmail.com <ed...@gmail.com> #28
I am using BOM 2023.04.01. No matter which version I use for androidx.compose.ui it does not work.
I am wondering whether there is some other dependency overriding the fix in a way that is does not work.
su...@gmail.com <su...@gmail.com> #29
when using the emulator, keyboard doesn't show up until you start typing using the hardware keyboard
ro...@google.com <ro...@google.com>
si...@google.com <si...@google.com> #30
P1 since it is reported to be a regression.
se...@google.com <se...@google.com> #31
First, prioritizing this as a regression for 1.5 and adding to burndown list. Lets get this sorted.
Second, the fix in this bug is only included in:
- Patch release: 1.4.3
- Alpha release: 1.5.0-alpha04
It was not included in 1.5.0-alpha03 as it didn't make the release cut.
In compose 1.4.3 - keyboard was shown properly when i clicked into text inputs there BUT if i clicked on some input which was partially hidden under keyboard it caused crash (see stacktrace above).
Thank you!
Can you share a minimal repro against 1.4.3 or 1.5.0-alpha04 with repro steps help expedite the fix.
Thanks!
ja...@gmail.com <ja...@gmail.com> #32
I tried version 1.5.0-alpha04 - keyboard is shown properly in that dialog but there is still that crash below (but its related to
E at androidx.compose.ui.node.NodeCoordinator.localToRoot-MK-Hz9U(NodeCoordinator.kt:844)
E at androidx.compose.foundation.text.TextFieldDelegate$Companion.notifyFocusedRect$foundation_release(TextFieldDelegate.kt:173)
E at androidx.compose.foundation.text.CoreTextFieldKt.notifyFocusedRect(CoreTextField.kt:1111)
E at androidx.compose.foundation.text.CoreTextFieldKt.notifyTextInputServiceOnFocusChange(CoreTextField.kt:962)
E at androidx.compose.foundation.text.CoreTextFieldKt.access$notifyTextInputServiceOnFocusChange(CoreTextField.kt:1)
E at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$focusModifier$1.invoke(CoreTextField.kt:293)
E at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$focusModifier$1.invoke(CoreTextField.kt:282)
E at androidx.compose.ui.focus.FocusChangedModifierNode.onFocusEvent(FocusChangedModifier.kt:59)
E at androidx.compose.ui.focus.FocusEventModifierNodeKt.refreshFocusEventNodes(FocusEventModifierNode.kt:68)
E at androidx.compose.ui.focus.FocusTransactionsKt.requestFocusForChild(FocusTransactions.kt:208)
E at androidx.compose.ui.focus.FocusTransactionsKt.performRequestFocus(FocusTransactions.kt:69)
E at androidx.compose.ui.focus.FocusTransactionsKt.requestFocus(FocusTransactions.kt:44)
E at androidx.compose.ui.focus.FocusRequester.focus$ui_release(FocusRequester.kt:72)
E at androidx.compose.ui.focus.FocusRequester.requestFocus(FocusRequester.kt:63)
E at androidx.compose.foundation.text.CoreTextFieldKt.tapToFocus(CoreTextField.kt:939)
E at androidx.compose.foundation.text.CoreTextFieldKt.access$tapToFocus(CoreTextField.kt:1)
E at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke-k-4lQ0M(CoreTextField.kt:342)
E at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke(CoreTextField.kt:341)
E at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke-k-4lQ0M(TextFieldPressGestureFilter.kt:81)
E at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke(TextFieldPressGestureFilter.kt:54)
E at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1.invokeSuspend(TapGestureDetector.kt:255)
E at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
E at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
E at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
E at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
E at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
E at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
E at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
E at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:670)
E at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl.dispatchPointerEvent(SuspendingPointerInputFilter.kt:546)
E at androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNodeImpl.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:568)
E at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:317)
E at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:303)
E at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:303)
E at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:303)
E at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:303)
E at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:303)
E at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:183)
E at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:102)
E at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:96)
E at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1376)
E at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1328)
E at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1268)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
E at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:500)
E at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1905)
E at android.app.Dialog.dispatchTouchEvent(Dialog.java:911)
E at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70)
E at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:458)
E at android.view.View.dispatchPointerEvent(View.java:15262)
E at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6654)
E at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6454)
E at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5910)
E at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5967)
E at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5933)
E at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6098)
E at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5941)
E at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6155)
E at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5914)
E at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5967)
E at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5933)
E at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5941)
E at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5914)
E at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8996)
E at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8947)
E at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8916)
E at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9119)
E at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:267)
E at android.os.MessageQueue.nativePollOnce(Native Method)
E at android.os.MessageQueue.next(MessageQueue.java:335)
E at android.os.Looper.loopOnce(Looper.java:161)
E at android.os.Looper.loop(Looper.java:288)
E at android.app.ActivityThread.main(ActivityThread.java:7872)
E at java.lang.reflect.Method.invoke(Native Method)
E at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@dc5dd85, androidx.compose.runtime.BroadcastFrameClock@9c07da, StandaloneCoroutine{Cancelling}@96ff40b, AndroidUiDispatcher@c8872e8]```
se...@google.com <se...@google.com> #33
Thanks, we've split the TextField bits of
From my testing it looks like the relevant keyboard ime for this ticket is now fixed, and a new bug (
I will close this ticket if the only issue currently is the crash caused by !isAttached
which is now tracked in a new bug.
If anyone has a repro other than the following crash, please comment and will re-open.
Crash below now tracked in b/281984756
1 @main: CRASH DETECTED on thread Thread[main,5,main]
E java.lang.IllegalStateException: LayoutCoordinate operations are only valid when isAttached is true
E at androidx.compose.ui.node.NodeCoordinator.localToRoot-MK-Hz9U(NodeCoordinator.kt:850)
E at androidx.compose.foundation.text.TextFieldDelegate$Companion.notifyFocusedRect$foundation_release(TextFieldDelegate.kt:173)
E at androidx.compose.foundation.text.CoreTextFieldKt.notifyFocusedRect(CoreTextField.kt:1111)
ed...@gmail.com <ed...@gmail.com> #34
ju...@google.com <ju...@google.com> #35
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3-android:1.2.0-alpha02
ri...@gmail.com <ri...@gmail.com> #36
sa...@gmail.com <sa...@gmail.com> #37
I encountered the problem described above on devices with API 28 (emulator and real device). When receiving focus on a TextField(BasicTextField) inside a ModalBottomSheet that is called from a BottomSheetDialogFragment, the keyboard does not appear.
I tried using the hack described above, but it doesn't work.
The latest BOM version is currently 2024.02.00.
mt...@gmail.com <mt...@gmail.com> #38
With Compose BOM Version 2024.02.00, the keyboard is still not showing in a DialogFragment, where ComposeView is used from within onCreateDialog with AlertDialog.Builder.setView as described in
ha...@sina.com <ha...@sina.com> #39
bug still happen with compose bom version 2024.05.00
、、、
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.WindowInsetsController com.android.internal.policy.DecorView.getWindowInsetsController()' on a null object reference at com.android.internal.policy.PhoneWindow.getInsetsController(PhoneWindow.java:3930) at androidx.core.view.WindowInsetsControllerCompat$Impl30.<init>(WindowInsetsControllerCompat.java:613) at androidx.core.view.WindowInsetsControllerCompat.<init>(WindowInsetsControllerCompat.java:102) at androidx.compose.ui.text.input.ImmHelper30.getInsetsControllerCompat(InputMethodManager.kt:133) at androidx.compose.ui.text.input.ImmHelper30.hideSoftInput(InputMethodManager.kt:152) at androidx.compose.ui.text.input.InputMethodManagerImpl.hideSoftInput(InputMethodManager.kt:83) at androidx.compose.ui.text.input.TextInputServiceAndroid.setKeyboardVisibleImmediately(TextInputServiceAndroid.android.kt:397) at androidx.compose.ui.text.input.TextInputServiceAndroid.processInputCommands(TextInputServiceAndroid.android.kt:302) at androidx.compose.ui.text.input.TextInputServiceAndroid.sendInputCommand$lambda$1(TextInputServiceAndroid.android.kt:209) at androidx.compose.ui.text.input.TextInputServiceAndroid.$r8$lambda$tFIm8sXGny3G873nGUe23EJe7OY(Unknown Source:0) at androidx.compose.ui.text.input.TextInputServiceAndroid$$ExternalSyntheticLambda0.run(Unknown Source:2) at androidx.compose.ui.text.input.TextInputServiceAndroid_androidKt.asExecutor$lambda$1$lambda$0(TextInputServiceAndroid.android.kt:504) at androidx.compose.ui.text.input.TextInputServiceAndroid_androidKt.$r8$lambda$RYljF3nl5HRu6JKEM8xFRHwbGFg(Unknown Source:0) at androidx.compose.ui.text.input.TextInputServiceAndroid_androidKt$$ExternalSyntheticLambda0.doFrame(Unknown Source:2) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1229) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239) at android.view.Choreographer.doCallbacks(Choreographer.java:899) at android.view.Choreographer.doFrame(Choreographer.java:827) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7872) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
、、、
di...@gmail.com <di...@gmail.com> #40
This bug is still present in BOM 2024.10.00
Description
Jetpack Compose version: 1.4.0-alpha03
Jetpack Compose component(s) used: Foundation + Material
Android Studio Build: Any
Kotlin version: 1.7.21
Steps to Reproduce or Code Sample to Reproduce:
Sample, requires
com.google.android.material:material
:Worked fine on 1.4.0-alpha02