Status Update
Comments
si...@google.com <si...@google.com>
b9...@gmail.com <b9...@gmail.com> #2
[Deleted User] <[Deleted User]> #3
[Deleted User] <[Deleted User]> #4
I tried adding a hook in the onFocusChanged
event of the textField
Modifier
s to scroll up, but doesn't seem to work as the view has yet to be resized, so it ends up as a no op when selecting a field at the end of the list. Are there any workarounds to this? As this is a pretty severe show stopper on my end and I have to resort to a recycler view instead...
b9...@gmail.com <b9...@gmail.com> #5
ed...@gmail.com <ed...@gmail.com> #6
Wow I actually came across this hilariously weird bug as well. For whatever reason a re-composition is triggered when you click the textfield, making it loose focus.
I noticed that the problem only occurs when the keyboard is fully overlapping the TextField
. Slightly altering your example and scrolling fully to the bottom """fixes""" the issue.
LazyColumn(Modifier.navigationBarsWithImePadding()) {
repeat(5) {
item {
Surface(Modifier.size(200.dp), color = Color.Blue) {
}
Spacer(Modifier.height(16.dp))
}
}
item {
TextField(value = "", onValueChange = { })
Spacer(Modifier.height(400.dp))
}
}
This led me to believe that window resizing is causing these re-compositions(?).
So I tried using android:windowSoftInputMode="adjustPan"
which prevents this and as expected this also """fixes""" the issue (not really).
Also, why does this only have P4 priority? Doesn't it make any basic editable form in a lazy column impossible to develop? However, it does sound like a few other keyboard issues mentioned here, so perhaps it's being addressed elsewhere.
si...@google.com <si...@google.com> #7
P4 means not triaged yet.
si...@google.com <si...@google.com> #8
CC'd others, this is again in the intersection of multiple components: lazy column, focus, window resize, maybe also textfield.
b9...@gmail.com <b9...@gmail.com> #9
#6
This led me to believe that window resizing is causing these re-compositions(?).
That's because navigationBarsWithImePadding()
will change the state when insets changed.
re...@gmail.com <re...@gmail.com> #10
That's because when textfield losing focus it's automatically triggering notifyTextInputServiceOnFocusChange
Thus under the hood will hide keyboard by TextFieldDelegate.onBlur(session, state.processor, onValueChange)
Seems that right now we don't have any option to prevent autohiding keyboard on focus lose.
Found this, because I have screen with many inputfields, and I noticed that keybaord reinvalidating on cursor change from textfeild to textfield, and thats became a problem if textfields has different input type (text/number) In this case keybaord has different heigh and the content starts jumping if pushed by ime-insets😢
ni...@google.com <ni...@google.com> #11
Bulk edit: This bug is currently marked as blocking Compose 1.0. Once rc01 is cut, all changes will need to go through our cherry-pick process.
If you intend to fix it in Compose 1.0, no action is needed except prioritizing finishing this work.
Otherwise, please remove this bug from the appropriate 1.0 hotlist (likely
Thanks!
ra...@google.com <ra...@google.com> #12
I took a look at this today and couldn't reproduce the automatic keyboard hiding with the tip of tree build. I think this is related to the navigationBarsWithImePadding modifier. Will re-visit this later. For now, I attached a gif of what I see:
[Deleted User] <[Deleted User]> #13
Huh I've retried it with beta-08 and I confirm I was not able to reproduce the error. See the attached video where I try at different positions in the list, the window even resizes correctly!
ra...@google.com <ra...@google.com> #14
Thanks for confirming! I'm going to mark this as fixed.
ja...@gmail.com <ja...@gmail.com> #15
You can see this demonstrated with the code here which I used to record a couple videos demonstrating the adjustResize and adjustPan behavior
b9...@gmail.com <b9...@gmail.com> #16
I found a weird issue about LazyColumn
Under adjustResize
mode, when setting reverseLayout = true
, the content will shift up with keyboard showing up, just like adjustPan
effect, if I don't reverse the layout, the content won't shift up and will covered by keyboard, makes the TextField out of canvas, so keyboard dismissed.
Is there any chance make same shift effect without reversing layout?
an...@google.com <an...@google.com> #17
ra...@google.com <ra...@google.com> #18
I was able to reproduce this. This happens because the focus item is disposed when it is scrolled out of view, which causes it to lose focus. I filed
ra...@google.com <ra...@google.com> #19
Assigning this to the text team for now,
mr...@gmail.com <mr...@gmail.com> #20
mr...@gmail.com <mr...@gmail.com> #21
[Deleted User] <[Deleted User]> #22
I am also experienced this bug in 1.2.0-beta02
and before. I have a TextField
in a scrollable LazyColumn
and when I click into the field, the keyboard opens up and closes immediately.
[Deleted User] <[Deleted User]> #23
Still happens in 1.2.0-beta02
jh...@gmail.com <jh...@gmail.com> #24
jf...@irhythmtech.com <jf...@irhythmtech.com> #25
still happening in 1.2.0-rc02
. Any update on this issue? This is a major blocker for us.
ga...@gmail.com <ga...@gmail.com> #26
a year and a half has past since this bug was posted, is there any update?
i would have expected a bug this severe to be resolved quicker
si...@google.com <si...@google.com>
b9...@gmail.com <b9...@gmail.com> #27
wi...@gmail.com <wi...@gmail.com> #28
mr...@gmail.com <mr...@gmail.com> #29
pa...@gmail.com <pa...@gmail.com> #30
[Deleted User] <[Deleted User]> #31
re...@gmail.com <re...@gmail.com> #32
an...@dif.tech <an...@dif.tech> #33
en...@gmail.com <en...@gmail.com> #34
st...@google.com <st...@google.com> #35
Hi there. This issue is of high importance to us and we are actively working on fixing it. However, it is caused by an intricate combination of issues and a fix is not trivial. We've most recently been focusing on
ap...@google.com <ap...@google.com> #36
Branch: androidx-main
commit d025c1f539f4de00c8d0ca0263f8a964b439023d
Author: Zach Klippenstein <klippenstein@google.com>
Date: Sun Dec 11 12:54:25 2022
Tests for focusable/lazy list interactions.
Focusables in lazy columns was fixed with both aosp/2178020 and
aosp/2304138. Since both those CLs were required to fix the issue,
neither of them included tests. This change un-ignores some existing
tests for text field that exercise the new code and adds a bunch of new
ones.
Fixes:
Test: LazyListFocusableInteractionTest
Test: CoreTextFieldKeyboardScrollableInteractionTest
Change-Id: I81678b7f0437d987664f444c3dc554d5b75aa69b
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/LazyListFocusableInteractionTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableFocusableInteractionTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/CoreTextFieldKeyboardScrollableInteractionTest.kt
[Deleted User] <[Deleted User]> #37
st...@google.com <st...@google.com> #38
Hi there, should be available in the next Compose foundation release, by mid January. Cheers.
na...@google.com <na...@google.com> #39
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.4.0-alpha04
jf...@irhythmtech.com <jf...@irhythmtech.com> #40
FYI this is still broke using LazyVerticalGrid
with compose 1.4.0-alpha04
@Composable
fun TestScreen() {
val values = remember { mutableStateMapOf(*Array(20) { it to "" }) }
LazyVerticalGrid(columns = GridCells.Fixed(1)) {
itemsIndexed(values.keys.toList()) { i: Int, _: Int ->
TextField(
value = values[i] ?: "",
onValueChange = { newValue ->
values[i] = newValue
},
label = {
Text("Field number $i")
}
)
}
}
}
kl...@google.com <kl...@google.com> #41
Confirmed this is an issue specific to LazyVerticalGrid
, filed
ta...@gmail.com <ta...@gmail.com> #42
When I use "androidx.compose.foundation:foundation:1.4.0-alpha04", LiveData Transformations no longer works error: "Unresolved reference: Transformations" livedata version: "androidx.lifecycle:lifecycle-livedata-ktx:2.5.1" any suggestions to fix this issue?
Description
When I scroll to bottom and click TextField, the keyboard open -> close instantly. How do I stay in focused editing state?
Using alpha10 & 11 has the same issue.