Obsolete
Status Update
Comments
ma...@google.com <ma...@google.com>
sz...@gmail.com <sz...@gmail.com> #2
Too bad a fix for this didn't make it into the May 10 release of 1.1.0. Hopefully soon?
sz...@gmail.com <sz...@gmail.com> #3
Same here. I need to do a custom action when pressing back when the modal is open. This is related to
ra...@google.com <ra...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 90075b00a1b5e5ebd24fb8c03f8a3fc2a7c72e98
Author: Kevin Truong <kevinctruong@google.com>
Date: Wed Oct 04 16:06:44 2023
[BottomSheet] Adding ModalBottomSheetProperties class
Adding a ModalBottomSheetProperties that contains securePolicy, isFocuable, and shouldDismissOnBackPress. securePolicy is taken from the ModalBottomSheet API and placed into this class for neatness.
isFocusable and shouldDismissOnBackPress are parameters that can be used to determine if the modal bottom sheet should receive IME events, and shouldDismissOnBackPress determines if the modal bottom sheet should dismiss when back is pressed on the IME. These parameters are ported from PopupProperties and the implementation is very similar to their usage within Popup.
Bug: 278216859
Test: Updating modalBottomSheet_imePadding test to use the isFocusable parameter, so the text field within the modal bottom sheet can receive focus.
Relnote: adding ModalBottomSheetProperties. Moving securePolicy into ModalBottomSheetProperties. Adding isFocusable and shouldDismissOnBackPress to ModalBottomSheetProperties. These new booleans help determine how modal bottom sheet should handle IME events.
Change-Id: Iea56ff84fd2f8a70037607e8aef0ceaf7a47e3d0
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ModalBottomSheetTest.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/ModalBottomSheet.android.kt
https://android-review.googlesource.com/2773725
Branch: androidx-main
commit 90075b00a1b5e5ebd24fb8c03f8a3fc2a7c72e98
Author: Kevin Truong <kevinctruong@google.com>
Date: Wed Oct 04 16:06:44 2023
[BottomSheet] Adding ModalBottomSheetProperties class
Adding a ModalBottomSheetProperties that contains securePolicy, isFocuable, and shouldDismissOnBackPress. securePolicy is taken from the ModalBottomSheet API and placed into this class for neatness.
isFocusable and shouldDismissOnBackPress are parameters that can be used to determine if the modal bottom sheet should receive IME events, and shouldDismissOnBackPress determines if the modal bottom sheet should dismiss when back is pressed on the IME. These parameters are ported from PopupProperties and the implementation is very similar to their usage within Popup.
Bug: 278216859
Test: Updating modalBottomSheet_imePadding test to use the isFocusable parameter, so the text field within the modal bottom sheet can receive focus.
Relnote: adding ModalBottomSheetProperties. Moving securePolicy into ModalBottomSheetProperties. Adding isFocusable and shouldDismissOnBackPress to ModalBottomSheetProperties. These new booleans help determine how modal bottom sheet should handle IME events.
Change-Id: Iea56ff84fd2f8a70037607e8aef0ceaf7a47e3d0
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ModalBottomSheetTest.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/ModalBottomSheet.android.kt
Description
Android Studio Build: Bumblebee RC01
Kotlin version: 1.6.10
Steps to Reproduce:
1.Start attached sample project in emulator
2.Start typing characters continuously into the BasicTextField in the middle (keyboard was used)
3.While typing press the "Button" (mouse was used), which will change a state and crash will occur due to conditional modifier.
Stacktrace:
2022-01-18 22:00:12.098 23755-23755/com.random.textfieldcrash E/InputEventSender: Exception dispatching finished signal for seq=20
2022-01-18 22:00:12.098 23755-23755/com.random.textfieldcrash E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
2022-01-18 22:00:12.104 23755-23755/com.random.textfieldcrash E/MessageQueue-JNI: java.lang.IllegalStateException: KeyEvent can't be processed because this key input node is not active.
at androidx.compose.ui.input.key.KeyInputModifier.processKeyInput-ZmokQxo(KeyInputModifier.kt:75)
at androidx.compose.ui.platform.AndroidComposeView.sendKeyEvent-ZmokQxo(AndroidComposeView.android.kt:531)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.android.kt:538)
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:490)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1880)
at android.app.Activity.dispatchKeyEvent(Activity.java:4156)
at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:122)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:404)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6278)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6144)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5626)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5814)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5871)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5847)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:6005)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3158)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2722)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2713)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3135)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:154)
at android.os.MessageQueue.nativePollOnce(Native Method)
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:7839)
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:1003)
2022-01-18 22:00:12.105 23755-23755/com.random.textfieldcrash D/AndroidRuntime: Shutting down VM
2022-01-18 22:00:12.113 23755-23755/com.random.textfieldcrash E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.random.textfieldcrash, PID: 23755
java.lang.IllegalStateException: KeyEvent can't be processed because this key input node is not active.
at androidx.compose.ui.input.key.KeyInputModifier.processKeyInput-ZmokQxo(KeyInputModifier.kt:75)
at androidx.compose.ui.platform.AndroidComposeView.sendKeyEvent-ZmokQxo(AndroidComposeView.android.kt:531)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.android.kt:538)
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:490)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1880)
at android.app.Activity.dispatchKeyEvent(Activity.java:4156)
at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:122)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:404)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6278)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6144)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5626)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5814)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5871)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5657)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5630)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5683)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5649)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5847)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:6005)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3158)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2722)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2713)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3135)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:154)
at android.os.MessageQueue.nativePollOnce(Native Method)
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:7839)
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:1003)
(If conditional modifier is not applied, error does not occur.)
Thank you.