Is there any way to force the `composition` field ...
# compose
e
Is there any way to force the
composition
field of a
TextField's
TextFieldValue
to be null? If I always set it to null, then after I change the text an infinite recomposition starts (assuming because the internal state of
composition
is not
null
and is calling
onValueChange
until it matches)
s
why do you want to force it to be null?
e
We're using a
BasicTextField
with a custom decoration to make it look like separate boxes per character (for a pin entry) and we don't want any composition applied to it.
s
composition was not intended to be changed but to inform. it will break the assumptions of both TextField but more importantly the keyboard. Not sure if there is a workaround for that at the moment. Not sure what you mean "per character" but if it is not digits, then the definition of "character" as commonly known is wildly different per language.
it is better to filter your text or how it looks rather than resetting composition.
e
By per character I mean per ASCII alphanumeric character, and that's unlikely to ever change for this particular feature