Status Update
Comments
jo...@google.com <jo...@google.com>
co...@protonmail.com <co...@protonmail.com> #2
to...@gmail.com <to...@gmail.com> #3
Current status: add 'disabled' and 'readOnly' together not to encourage usages of 'disabled' when the 'readOnly' should be used. However, 'readOnly' is blocked on 2 pieces of work - focus work (focus a TF without showing the keyboard) and cursor API work (focus a TF without showing the cursor).
Moving the ticket to further release.
jo...@google.com <jo...@google.com> #4
[EDIT] after I commented here, I saw that 169035120 requests exactly that :)
to...@gmail.com <to...@gmail.com> #5
Yes, we are reworking the focus API at the moment. And being able to focus the text field without showing the soft keyboard is part of the requirements.
jo...@google.com <jo...@google.com> #6
let's create a disabled ticket; leave the read only as a separate work.
to...@gmail.com <to...@gmail.com> #7
Keeping this ticket for disabled as this was the initial request. There's a separate request for read-only
ro...@gmail.com <ro...@gmail.com> #10
ro...@gmail.com <ro...@gmail.com> #11
Done.
kl...@google.com <kl...@google.com> #12
Branch: androidx-main
commit 18d398281228fd3c116553c608f45635fd3488ea
Author: Anastasia Soboleva <soboleva@google.com>
Date: Tue Dec 08 11:01:54 2020
Add support for disabled and read-only text fields
Bug: 171040474
Fixes: 166478534
Test: new tests
Relnote: "Added support for disabled and read-only text fields"
Change-Id: I352791811a7b75189013e1ed73c9834cfa5ce961
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/build.gradle
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/InactiveTextFieldTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/MaxLinesHeightModifierTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/SoftwareKeyboardTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldCursorTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldDefaultWidthTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldFocusTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldOnValueChangeTextFieldValueTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldScrollTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/BasicTextField.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
A compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/InactiveTextField.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/MaxLinesHeightModifier.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldScroll.kt
M compose/material/material/api/current.txt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/MaterialTextField.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/OutlinedTextFieldScreenshotTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/TextFieldScreenshotTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/OutlinedTextField.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextField.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextFieldImpl.kt
co...@protonmail.com <co...@protonmail.com> #13
I'm getting a similar crash. I have a small app (5 users) and it's happening to 2 users. i cant repro. the app is pretty small since im in beta at the moment.
Fatal Exception: java.lang.IllegalStateException: Cannot obtain node coordinator. Is the Modifier.Node attached?
at androidx.compose.ui.internal.InlineClassHelperKt.throwIllegalStateExceptionForNullCheck(InlineClassHelper.kt:30)
at androidx.compose.ui.node.DelegatableNodeKt.requireLayoutNode(DelegatableNode.kt:1389)
at androidx.compose.ui.node.DelegatableNodeKt.requireOwner(DelegatableNode.kt)
at androidx.compose.ui.Modifier$Node.getCoroutineScope(Modifier.kt:207)
at androidx.compose.foundation.FocusableNode.onFocusEvent(Focusable.kt:221)
at androidx.compose.foundation.AbstractClickableNode.onFocusEvent(Clickable.kt:1102)
at androidx.compose.ui.focus.FocusEventModifierNodeKt.refreshFocusEventNodes(FocusEventModifierNode.kt:68)
at androidx.compose.ui.focus.FocusTransactionsKt.performRequestFocus(FocusTransactions.kt:82)
at androidx.compose.ui.focus.FocusTransactionsKt.requestFocus-Mxy_nc0(FocusTransactions.kt:50)
at androidx.compose.ui.platform.AndroidComposeView$keyInputModifier$1$focusWasMovedOrCancelled$1.invoke(AndroidComposeView.java:343)
at androidx.compose.ui.platform.AndroidComposeView$keyInputModifier$1$focusWasMovedOrCancelled$1.invoke(AndroidComposeView.java:342)
at androidx.compose.ui.focus.FocusOwnerImpl$focusSearch$1.invoke(FocusOwnerImpl.java:250)
at androidx.compose.ui.focus.FocusOwnerImpl$focusSearch$1.invoke(FocusOwnerImpl.java:246)
at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.searchChildren-4C6V_qg(TwoDimensionalFocusSearch.kt:185)
at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.generateAndSearchChildren-4C6V_qg(TwoDimensionalFocusSearch.kt)
at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.twoDimensionalFocusSearch-sMXa3k8(TwoDimensionalFocusSearch.kt:88)
at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.twoDimensionalFocusSearch-sMXa3k8(TwoDimensionalFocusSearch.kt:77)
at androidx.compose.ui.focus.FocusTraversalKt.focusSearch-0X8WOeE(FocusTraversal.kt:109)
at androidx.compose.ui.focus.FocusOwnerImpl.focusSearch-ULY8qGw(FocusOwnerImpl.kt:246)
at androidx.compose.ui.platform.AndroidComposeView$keyInputModifier$1.invoke-ZmokQxo(AndroidComposeView.java:342)
at androidx.compose.ui.platform.AndroidComposeView$keyInputModifier$1.invoke(AndroidComposeView.java:334)
at androidx.compose.ui.input.key.KeyInputNode.onKeyEvent-ZmokQxo(KeyInputModifier.kt:80)
at androidx.compose.ui.focus.FocusOwnerImpl.dispatchKeyEvent-YhN2O0w(FocusOwnerImpl.kt:273)
at androidx.compose.ui.focus.FocusOwner.dispatchKeyEvent-YhN2O0w$default(FocusOwner.java:142)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.android.kt:950)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1964)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1964)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1964)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1964)
at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:486)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1880)
at android.app.Activity.dispatchKeyEvent(Activity.java:4159)
at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.kt:103)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:85)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.kt:117)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:400)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6377)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6243)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5725)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5913)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5970)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5946)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:6104)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3159)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2723)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2714)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3136)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:154)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:161)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7870)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1009)
What's most interesting is that i dont have any text input in my app. my app is essentially two buttons, and a lazylist.
co...@protonmail.com <co...@protonmail.com> #14
Not sure if it's actually helpful. but it seems to only happen on Pixel 6 Pro. but with only 5 users. that could be a red herring
br...@adesso-mobile.de <br...@adesso-mobile.de> #15
At least the disabled click listener in the parent an a custom TextFieldDecorator are present as well.
Device: Pixel 8, Android 14.
an...@sigma.software <an...@sigma.software> #16
Similar crash:
Fatal Exception: java.lang.IllegalStateException: Cannot read CompositionLocal because the Modifier node is not currently attached.
at androidx.compose.ui.node.CompositionLocalConsumerModifierNodeKt.currentValueOf(CompositionLocalConsumerModifierNode.kt:72)
at com.my.package.RequestAutofillOnFocusedNode.onFocusEvent(AutofillModifier.kt:171)
at androidx.compose.ui.focus.FocusInvalidationManager$invalidateNodes$1.invoke(FocusInvalidationManager.kt:79)
at androidx.compose.ui.focus.FocusInvalidationManager$invalidateNodes$1.invoke(FocusInvalidationManager.kt:57)
at androidx.compose.ui.platform.AndroidComposeView.onEndApplyChanges(AndroidComposeView.android.kt:742)
at androidx.compose.ui.node.UiApplier.onEndChanges(UiApplier.android.kt:48)
at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:978)
at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:1005)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:639)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:551)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.java:109)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.java:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1404)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1415)
at android.view.Choreographer.doCallbacks(Choreographer.java:1015)
at android.view.Choreographer.doFrame(Choreographer.java:941)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1389)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8592)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
lp...@google.com <lp...@google.com> #17
R.e AutofillModifier
- make sure to guard your composition local read with if (isAttached)
, since you are currently trying to query this when the node is unattached.
For the other issues in this bug, this is no longer an issue in 1.8, and we are looking at backporting a fix for this to 1.7
ap...@google.com <ap...@google.com> #18
Branch: androidx-main
commit b15d0eefd3ecc892ff01bfe532a41e9c421acf51
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Wed Aug 14 17:11:58 2024
Adds regression test for a disabled clickable crashing on focus event
This was fixed as a side effect of refactoring clickable and focusable to directly delegate to a FocusTargetNode.
Bug:
Test: ClickableTest
Change-Id: I717676e75fe31807744834d0cfa1570cd2221ac7
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/ClickableTest.kt
na...@google.com <na...@google.com> #20
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.7.0-rc01
androidx.compose.foundation:foundation-android:1.7.0-rc01
androidx.compose.foundation:foundation-desktop:1.7.0-rc01
sa...@gmail.com <sa...@gmail.com> #21
We are still seeing the crash in our app after updating to 1.7.2 (BOM 2024.09.02). Ours is a View interop case. (Two text fields and a Compose Button in XML layout). Clicking on IME done crashes the app with:
Fatal Exception: java.lang.IllegalStateException: focus search returned a view that wasn't able to take focus!
at android.widget.TextView.onKeyUp(TextView.java:10271)
at android.view.KeyEvent.dispatch(KeyEvent.java:3175)
at android.view.View.dispatchKeyEvent(View.java:15781)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:591)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:591)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:669)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:2010)
at android.app.Activity.dispatchKeyEvent(Activity.java:4595)
at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.kt:103)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:85)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.kt:117)
at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:604)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3397)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:515)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:7822)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:7679)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7058)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:7125)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:7086)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:7259)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:7094)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:7316)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7062)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:7125)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:7086)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:7094)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7062)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:10383)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:10334)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:10295)
at android.view.ViewRootImpl$ViewRootHandler.handleMessageImpl(ViewRootImpl.java:6803)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:6667)
at android.os.Handler.dispatchMessage(Handler.java:108)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:328)
at android.app.ActivityThread.main(ActivityThread.java:9239)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
lp...@google.com <lp...@google.com> #22
This seems like a different issue, please file a new bug (with sample code if you have it)
Description
Jetpack Compose version: 1.7 snapshot 11251205
Jetpack Compose component(s) used: many
Android Studio Build:Android Studio Iguana | 2023.2.1 Canary 18
Kotlin version: 1.9.21
I do not have yet a repro and moving to holidays but reporting this new crash that I just get on Crashlytics.
The device was probably connected to AS via Running device so it's possible the keyevent was from keyboard on AS. I did not see the crash so no idea. If you need things to test I'll check when back from holidays.