Status Update
Comments
wh...@gmail.com <wh...@gmail.com> #2
Wow, it seems like a very important bug to fix.
Doing some investigations...
It works fine with CoreTextField as well as BaseTextField.
[Deleted User] <[Deleted User]> #3
Seems to be a duplicate of
il...@google.com <il...@google.com> #4
It works fine with Material TextFields (both filled and outline) if you use TextFieldValue based overloads.
It doesn't work when you use String based overloads however (both Outline and Filled). I believe this is related to the one-frame lag as we host TextFieldValue internally and proxy only string.
jo...@jossiwolf.de <jo...@jossiwolf.de> #5
Chatted with Anastasia.
We have this code
// "value: String" comes as a param in TextField
TextFieldImpl(
type = TextFieldType.Outlined,
value = textFieldValue,
onValueChange = {
selection = it.selection
composition = it.composition
if (value != it.text) {
onValueChange(it.text)
}
},
and this value is always ""
for me, as it's captured my lambda when lambda was created and this lambda is saved and reused by CoreTextField.
Anyway, two things we can do:
- Remove this if and invoke
onValueChange
everytime, even on the selection change (which we don't care about). This will allow us to workaround quickly and not to let it slip through. - Find and implement the proper fix in CoreTextField
Let me know what you think
jo...@jossiwolf.de <jo...@jossiwolf.de> #6
Updated the details here
il...@google.com <il...@google.com>
de...@gmail.com <de...@gmail.com> #7
Just a note that this issue affects String overrides of both material text fields as well as any custom String override text fields that developer might create on top of CoreTextField/BaseTextField.
pa...@gmail.com <pa...@gmail.com> #8
Branch: androidx-master-dev
commit 1717097cfa889c564450626af6d5dcc405581d79
Author: Anastasia Soboleva <soboleva@google.com>
Date: Mon Aug 24 16:38:59 2020
Fix lambda value being captured for string override text fields
Fixes: 163834907
Fixes: 163808219
Fixes: 165956313
Test: new test in TextFieldTest#stringOverrideTextField_canDeleteLastSymbol
Test: foundation and material tests passed
Change-Id: I9932a2bddc3859a2a35a54e0b6d7cb525853d3ac
M compose/foundation/foundation-text/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/TextFieldTest.kt
il...@google.com <il...@google.com> #9
Which release is this fix going to be a part of? Also, what's the best way to know which version a change will be a part of in general?
ap...@google.com <ap...@google.com> #10
This fix will be available in the upcoming release.
As for the second question, I'm not sure I've got a good answer for that one. I'd say normally if it's marked as fixed, it'll be available within two next releases.
jb...@google.com <jb...@google.com> #11
This has been added internally and will be released as part of the compose.material
library, not navigation.
na...@google.com <na...@google.com> #12
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material:material:1.7.0-alpha04
androidx.compose.material:material-android:1.7.0-alpha04
androidx.compose.material:material-desktop:1.7.0-alpha04
d....@gmail.com <d....@gmail.com> #13
gs...@gmail.com <gs...@gmail.com> #14
I guess the release that addresses this is actually:
androidx.compose.material:material-navigation:1.7.0-alpha04
As #13 said, we are missing this for Material3 bottom sheets.
I see that there's another issue tracking that here:
v....@temper.works <v....@temper.works> #15
Some guidance about usage would be very welcome. I get java.lang.IllegalStateException: Could not find Navigator with name "bottomSheet". You must call NavController.addNavigator() for each navigation type.
crash and can't find any proper example of this new extension usage:
Scaffold(
bottomBar = {...}
) { innerPadding ->
NavHost(
navController,
startDestination = "explore_graph",
Modifier.fillMaxSize()
) {
// nested graphs
bottomSheet("profile_bottom_sheet") { // CRASHES
Text("Bottom Sheet", Modifier.padding(16.dp))
}
}
}
}
}
}
}
I use androidx.compose.material:material-navigation:1.7.0-beta01
, but my project is material3, could it be the reason?
il...@google.com <il...@google.com> #16
Re
val bottomSheetNavigator = rememberBottomSheetNavigator()
val navController = rememberNavController(bottomSheetNavigator)
If you don't use those lines, you'd get that error message.
Description
Version used: 1.0.0-alpha06
It would be useful to integrate with BottomSheetScaffold so we could treat bottom sheets as navigation destinations. For example, I could call `navController.navigate(someBottomSheetRoute)` to launch a bottom sheet.