Status Update
Comments
si...@google.com <si...@google.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.
lp...@google.com <lp...@google.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.
so...@google.com <so...@google.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.
si...@google.com <si...@google.com> #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
ni...@google.com <ni...@google.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.
ma...@google.com <ma...@google.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.
si...@google.com <si...@google.com> #8
Yes, this fix is planned to be included in a future 1.7.x
release.
si...@google.com <si...@google.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.
lp...@google.com <lp...@google.com> #10
My first question here is actually less about where this API should live, but what actually is a placeholder.
I'm not sure I agree that it depends upon design system; I can see many users wanting a simple placeholder that appears when no text is entered and disappears otherwise. Correctly implementing could be complex to correctly synchronize alignment, lines height, cursor etc. I see the benefit of having this in a library function that we can update etc.
Appearing / dissapearing already implies some UX - will there be a transition? If so, what is the transition? Can developers customize it?
Similarly for positioning, padding from the sides, size, etc. There is no non-Material answer here, we will need some numbers so it can actually be implemented.
This is also IMO a problem with the core / foundation level text fields, it's impossible to build such a component without some UI, and developers are routinely confused by how 'ugly' the foundation level component is, and how it doesn't support Material features.
We had similar problems before discussing the default minimum width for a TextField, again, unavoidable given that TextField by design occupies space on screen, but it causes a lot of confusion as there is not really a consistent / correct answer here without referring to a specific design system. I have the same concerns here with placeholder, and I think avoiding these problems / confusion between API layers is a good idea.
so...@google.com <so...@google.com> #11
+1 to Louis' point above.
Back to the idea of PlaceholderTextField, I personally don't see it as a way forward. One thing is when you have it as a sample that shows a way to add a placeholder to the TextField. And developers can iterate on this example and add opinionated placeholders to their custom text fields.
But as Matvei mentioned, "PlusOneFeature components in foundation" is not a good idea. Imagine we added a placeholder (even if we figured out some UI for it) and solved that particular problem. Later developers come and say that they need to put an icon to the text field. Should we create a more complex text field similar to MD text fields? Or should we create a StartIconTextField?
si...@google.com <si...@google.com> #12
looks like we have an agreement that placeholder should not be in foundation. will close the ticket. Nick, please feel free to reopen.
ap...@google.com <ap...@google.com> #13
Branch: androidx-master-dev
commit 790b311b6a6e73928d808e8cef04d8f48026e9fb
Author: Matvei Malkov <malkov@google.com>
Date: Wed Jul 15 14:09:37 2020
Rename material.FilledTextField to material.TextField and foundation.TextField to foundation.BaseTextField with experimental marker.
Per design doc, per many discussions and per study feedback it became clear that it's a good idea to give the hottest name to the thing people want the most: ready-to-use material TextField, while also leaving this name for other design systems to utilise if they don't follow material.
I've done this renaming, but we haven't decided on the future of 3 overloads just yet. therefore all 3 stay for now, but I marked foundation.BaseTextField as experimental as it might (not must) potentially go away.
According deprecation annotations were added to the old APIs
Relnote: "Material FilledTextField was renamed to TextField and foundational TextField was renamed to BaseTextField to make simplest desired API easy to discover and use"
Bug: 155482676
Test: fixed, should pass
Change-Id: Ia62420a7a2231c02b6874a9a2867bf786a397ed3
M compose/compose-runtime/samples/src/main/java/androidx/compose/samples/ModelSamples.kt
M compose/compose-runtime/samples/src/main/java/androidx/compose/samples/MutableStateListSamples.kt
M compose/compose-runtime/samples/src/main/java/androidx/compose/samples/MutableStateMapSample.kt
M ui/integration-tests/demos/src/main/java/androidx/ui/demos/DemoFilter.kt
M ui/ui-core/integration-tests/ui-core-demos/build.gradle
M ui/ui-core/integration-tests/ui-core-demos/src/main/java/androidx/ui/core/demos/PopupDemo.kt
M ui/ui-core/integration-tests/ui-core-demos/src/main/java/androidx/ui/core/demos/autofill/ExplicitAutofillTypesDemo.kt
M ui/ui-foundation/api/0.1.0-dev16.txt
M ui/ui-foundation/api/current.txt
M ui/ui-foundation/api/public_plus_experimental_0.1.0-dev16.txt
M ui/ui-foundation/api/public_plus_experimental_current.txt
M ui/ui-foundation/api/restricted_0.1.0-dev16.txt
M ui/ui-foundation/api/restricted_current.txt
M ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/TextFieldSample.kt
M ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/ui/foundation/SoftwareKeyboardTest.kt
M ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/ui/foundation/TextFieldCursorTest.kt
M ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/ui/foundation/TextFieldOnValueChangeTextFieldValueTest.kt
M ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/ui/foundation/TextFieldTest.kt
M ui/ui-foundation/src/commonMain/kotlin/androidx/ui/foundation/BaseTextField.kt
A ui/ui-foundation/src/commonMain/kotlin/androidx/ui/foundation/ExperimentalFoundationApi.kt
M ui/ui-material/api/0.1.0-dev16.txt
M ui/ui-material/api/current.txt
M ui/ui-material/api/public_plus_experimental_0.1.0-dev16.txt
M ui/ui-material/api/public_plus_experimental_current.txt
M ui/ui-material/api/restricted_0.1.0-dev16.txt
M ui/ui-material/api/restricted_current.txt
M ui/ui-material/integration-tests/material-demos/src/main/java/androidx/ui/material/demos/MaterialTextField.kt
M ui/ui-material/samples/src/main/java/androidx/ui/material/samples/TextFieldSamples.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/FilledTextFieldTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/TextField.kt
M ui/ui-material/src/main/java/androidx/ui/material/TextFieldImpl.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-text/integration-tests/ui-text-compose-demos/build.gradle
M ui/ui-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/ui/text/demos/ComposeInputField.kt
M ui/ui-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/ui/text/demos/ComposeInputFieldFocusTransition.kt
M ui/ui-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/ui/text/demos/ComposeInputFieldTrickyUseCase.kt
M ui/ui-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/ui/text/demos/ComposeVariousInputField.kt
M ui/ui-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/ui/text/demos/TailFollowingTextField.kt
M ui/ui-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/ui/text/demos/TextFieldWIthScroller.kt
ma...@google.com <ma...@google.com> #14
Renamed FilledTextField to TextField, so the most hot traffic name will be easy to reach and it will have placeholders / label / etc
Description
Currently higher level components like
FilledTextField
offer aplaceholder
slot, but foundation's TextField does not. Would we consider adding this?