Fixed
Status Update
Comments
lp...@google.com <lp...@google.com>
ap...@google.com <ap...@google.com> #2
foe example in the example provided in
var text by remember { mutableStateOf("Text") }
val handler = remember { Handler(Looper.getMainLooper()) }
OutlinedTextField(
value = text,
onValueChange = {
handler.removeCallbacksAndMessages(null)
handler.postDelayed({
text = it
}, 10)
},
label = { Text("Label") },
modifier = Modifier.fillMaxWidth()
)
When the above function is called, it is not impossible for CoreTextField to know about it. What happens is
- CoreTextField gets value text
- when user types onValueChange is fired
- (developer delays the new value for recompose)
- CoreTextField after onValueChange requests a recompose
- When recompose happens the changed data is passed to developer, and recompose happens with old data (therefore it is not possible to change the cursor location by user either, since it resets to initial value)
pr...@google.com <pr...@google.com> #3
While working on the new APi here are the things we want to update in the current API so that we can clear some of the bugs:
- Make TextFieldValue.composition readonly (aosp/1499610)
- I figured that when composition is "reset" to null (which should happen automatically when text has changed), we do not inform the IME about this fact. This requires us to reset the IME with the new information at hand.
- [Optional] provide mechanism to prevent users creating a new TextFieldValue in onValueChange forgetting to set selection, composition. One of the ideas here was to have TextRange.Unspecified that is the default value for selection and composition. This way we can understand the intention of the developer, if they wanted to reset those fields or if they did not change them. This is in order to prevent cases such as
b/171860947
Description
Perf Regression (High) found, matching 63 tracked metrics from benchmarks.
To triage this regression, see the guide at go/androidx-bench-triage .
Test classes affected:
Test methods affected:
Devices affected:
API Level: