Status Update
Comments
g....@cmcmarkets.com <g....@cmcmarkets.com> #2
g....@cmcmarkets.com <g....@cmcmarkets.com> #3
I get different results for these scenarios:
1 - The code above, where Column has no children: Ui v1.6.8: Works, Ui v1.7.5: Crashes
2 - If I put a TextField in the Column: Ui v1.6.8: Works, Ui v1.7.5: Works
3 - If I put a Text in the Column: Ui v1.6.8 Material3 v1.2.1 (same BOM): Works, Ui v1.7.5: Crashes
PS: The 3rd option crashes too with Ui:1.6.8 and Material3: 1.3.1
Currently only it doesn't crash with a TextField as far as I can see in with 1.7.5, I don't think the fix addresses the initial ticket opened, e.g., where there is a Text in compose view
ke...@bandlab.com <ke...@bandlab.com> #4
ta...@gotinder.com <ta...@gotinder.com> #5
Looks similar to
What helped for us was Modifier.focusable()
to the root composable in our ComposeView
/AbstractComposeView
(we have a lot of custom AbstractComposeView
components).
Not sure what is going on with the fix:
If these issues are similar, then we are also seeing a lot of these in the wild, and they're hard to repro and patch 💥
If the team could expedite the fix and cherry-pick into a stable Compose version that would be much appreciated 🙏🏼
pe...@gmail.com <pe...@gmail.com> #6
We shouldnt have a crash when user clicks enter on keyboard.
Even alpha 7 1.8.0 has this issue
Description
Jetpack Compose component(s) used: ComposeView
Android Studio Build: #AI-241.18034.62.2411.12169540 (Android Studio Koala | 2024.1.1 Patch 2)
Kotlin version: 1.9.0
Steps to Reproduce or Code Sample to Reproduce:
1. Create project with an activity with an xml layout that has a vertical LinerLayout parent view group
2. In linear layout, create an EditText with android:imeOptions="actionNext" and android:inputType="numberDecimal"
3. Again in linear layout, under the EditText, create a ComposeView (v 1.7.0-beta04)
4. In the activity, set content of the ComposeView, e.g. a composable Text
5. Run the app and tap on the EditText to show keypad
6. In the keypad, tap next button to focus on the AndroidComposeView that is created by compose
7. App crashes because AndroidComposeView that is found by onEditorAction is not focusable
8. It doesn't crash in stable version of ComposeView v1.6.8
PS: Please note that to reproduce ComposeView shouldn't have a TextField in it.
Stack trace (if applicable):
```
FATAL EXCEPTION: main (Ask Gemini)
Process: com.example.myapplication, PID: 16396
java.lang.IllegalStateException: focus search returned a view that wasn't able to take focus!
at android.widget.TextView.onEditorAction(TextView.java:7420)
at com.android.internal.inputmethod.EditableInputConnection.performEditorAction(EditableInputConnection.java:156)
at com.android.internal.inputmethod.RemoteInputConnectionImpl.lambda$performEditorAction$21$com-android-internal-inputmethod-RemoteInputConnectionImpl(RemoteInputConnectionImpl.java:654)
at com.android.internal.inputmethod.RemoteInputConnectionImpl$$ExternalSyntheticLambda33.run(Unknown Source:6)
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)
```