Status Update
Comments
si...@google.com <si...@google.com>
ng...@gmail.com <ng...@gmail.com> #2
First of all thanks for this detailed issue.
This issue had been investigated thoroughly when it was first reported internally. The surprising detail in this report is that the issue is not reproducible before 1.7
. I will look into this.
The main problem with POBox is the fact that it is deprecated. Since 2021 Sony has been shipping new Xperia devices with Gboard pre-installed. Although we are aware that there is still a considerable amount of users still using POBox, the described behavior is caused by POBox's noncompliant behavior with InputConnection
and InputMethodManager
documentation. However, this is understandable since TextView
implementation was also not respecting the behavior that is expected from Editors.
Ultimately we have decided to enforce the documented behavior with specifically regards to when editors should call InputMethodManager.updateSelection
. Also, although unconfirmed, there were traces of possible custom code being included in Sony OEM images that changed how InputMethodManager was notified from TextView. If POBox also depended on something like this, it would be impossible for Compose code to replicate the same unknown behavior.
op...@gmail.com <op...@gmail.com> #3
Or is that option not available?
Even if the root cause is POBox, from the perspective of the app's customers, it looks like an app bug, so this issue is a blocker against updating Jetpack Compose.
na...@gmail.com <na...@gmail.com> #4
Just to be sure, it is dangerous to replace Compose TextField with Android View EditText as a workaround for this issue.
Compose 1.7 has a bug that causes ANR when the focus is on EditText.
Another View-related bug in Compose 1.7 is that an Android View is focused by calling FocusManager.clearFocus().
Perhaps there is a lack of testing of Compose 1.7 in combination with Android View. There is also a possibility that there are other fatal bugs related to View.
In other words, the only options for apps targeting the Japanese market that require POBox support are to continue using Compose 1.6 or to use EditText in combination with various workarounds.
[Deleted User] <[Deleted User]> #5
Project: platform/frameworks/support
Branch: androidx-main
Author: Halil Ozercan <
Link:
Fix POBox keyboard issue
Expand for full commit details
Fix POBox keyboard issue
Fix: 373743376
Fix: 329209241
Test: NullableInputConnectionWrapperTest
Change-Id: I94e0e598274fb88b255f977f9fbd50dfbbb1ecb1
Files:
- M
compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/text/input/NullableInputConnectionWrapperTest.kt
- M
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/NullableInputConnectionWrapper.android.kt
Hash: 57f58c4b80d5d8470b2aca325dfdcd55f235231e
Date: Thu Oct 24 01:25:20 2024
zo...@gmail.com <zo...@gmail.com> #6
Many thanks again for this report. Especially for giving us a huge clue in terms of what could be going wrong. The fix is now merged and I will ask for a cherry-pick into a stable release.
r....@gmail.com <r....@gmail.com> #7
Do you have any concrete plan to cherry-pick the fix into current stable version (1.7.x)? We are currently waiting it.
ch...@gmail.com <ch...@gmail.com> #8
Yes, this fix is planned to be included in a future 1.7.x
release.
kl...@google.com <kl...@google.com>
gb...@appolica.com <gb...@appolica.com> #9
Thanks for the fix. Sorry to follow up on this. is it possible for you to share specific release version/date for the stable version? We are waiting on this to decide on our direction.
ja...@gmail.com <ja...@gmail.com> #10
[Deleted User] <[Deleted User]> #11
al...@deliverymuch.com.br <al...@deliverymuch.com.br> #12
ch...@gmail.com <ch...@gmail.com> #13
mi...@gmail.com <mi...@gmail.com> #14
iv...@gmail.com <iv...@gmail.com> #15
Hope google will pay its attention on this bug someday :D
ha...@gmail.com <ha...@gmail.com> #16
jo...@gmail.com <jo...@gmail.com> #17
sc...@gmail.com <sc...@gmail.com> #18
mi...@gmail.com <mi...@gmail.com> #19
br...@gmail.com <br...@gmail.com> #20
Video attached. Seems like a pretty big issue, might delay are move to Compose over this.
la...@gmail.com <la...@gmail.com> #21
Perhaps a walk around ?
ch...@hotstar.com <ch...@hotstar.com> #22
ja...@gmail.com <ja...@gmail.com> #23
6o...@gmail.com <6o...@gmail.com> #24
ko...@gmail.com <ko...@gmail.com> #25
mu...@gmail.com <mu...@gmail.com> #26
kl...@google.com <kl...@google.com> #28
Probably the same bug, but I've noticed just using the backspace button in a single text field can also cause this to happen, it's like the keyboard/IME is being reloaded with every backspace!
Can you share repro code? I can definitely reproduced the issue with the code in the original issue description, but I haven't been able to reproduce with just backspace in a single field.
th...@gmail.com <th...@gmail.com> #29
Is there any workaround available for this issue?
ct...@gmail.com <ct...@gmail.com> #30
ap...@google.com <ap...@google.com> #32
Branch: androidx-main
commit 3f9688cc817a0620544193538d92d40ed730a195
Author: Zach Klippenstein <klippenstein@google.com>
Date: Sun Jan 16 18:12:45 2022
Debounce restart input commands in TextInputServiceAndroid.
In Compose, we hide the soft keyboard and close the input connection every time the text field loses focus.
Android, as far as I can tell, only does this cleanup when focus is being truly cleared and not moving to another view, which only happens after the window is detached.
This means that when focus is moved between multiple Android TextViews, each one starts a new input session without closing the old one, in a single (atomic-ish) step, and if the IME options are the same then the keyboard doesn’t change. This bug happens in Compose because we first close the connection before opening another one, and so the keyboard will reset to its default state before the IME options from the new field are applied from its new session.
The fix is to debounce restartInput operations on the IME in the same way
that we already debounce show/hide operations.
See this doc for more discussion about what caused this bug and how
it's fixed:
Fixes:
Test: Manual testing to verify the issue described in
Test: Unit tests for the new TextInputServiceAndroid debouncing:
./gradlew :compose:ui:ui:test
Test: Additional integration test that text fields are calling the right
PlatformTextInputService methods when focus changes.
Relnote: "The soft keyboard input type no longer flickers when changing
focus between text fields."
Change-Id: I1bf50cacddd8e20f9bd3d5124f277e5fef467ac0
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/CoreTextFieldInputServiceIntegrationTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextFieldDelegateTest.kt
A compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TextFieldFocusKeyboardInteraction.kt
A compose/ui/ui/src/test/kotlin/androidx/compose/ui/text/input/TextInputServiceAndroidCommandDebouncingTest.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TextDemos.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/TextInputServiceAndroid.android.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/platform/LocalSoftwareKeyboardControllerTest.kt
mo...@gmail.com <mo...@gmail.com> #33
kl...@google.com <kl...@google.com> #34
That fix went out in 1.2.0-alpha03.
di...@gmail.com <di...@gmail.com> #35
sh...@gmail.com <sh...@gmail.com> #36
Note: It occurs only when windowSoftInputMode is set to 'adjustResize'.
jo...@langlive.com <jo...@langlive.com> #37
si...@sentbe.com <si...@sentbe.com> #38
While the text field is focused, try opening the modal bottom sheet through some operation(e.g. pressing a button).
When the bottom sheet is opened, the keyboard closes. After closing the bottom sheet, if you press the text field again to raise the keyboard, the keyboard option changes to Default.
but, if you remove the focus of the text field and open the bottom sheet, keyboard option will not change.
I think the system is causing an unexpected (bottom sheet) behavior that kills the keyboard and overrides the ime option.
I want to keep the keyboard options regardless of focus.
sy...@gmail.com <sy...@gmail.com> #39
kl...@google.com <kl...@google.com> #40
The comments on this issue since it's been closed seem to be discussing multiple different bugs. Please file new bugs for these.
Description
Jetpack Compose release version: 1.0.0-beta06
Android Studio Build: Android Studio Arctic Fox | 2020.3.1 Canary 15 Build #AI-203.7717.56.2031.7321754, built on April 28, 2021 Runtime version: 11.0.10+0-b96-7281165 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 11.2.3 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 16 Registry: external.system.auto.import.disabled=true Non-Bundled Plugins: idea.plugin.protoeditor, org.jetbrains.kotlin, org.intellij.plugins.markdown
I’m facing a strange behavior with focus + keyboard type… All the
TextField
s are numeric and when I move the focus to the previousTextField
, the keyboard type changes very quickly to the alpha numeric and then changes back again to the numeric…Here’s my code:
Please see the attached GIF which demonstrate the scenario. This is happening both on emulator and real device.