I’ve observed one more issue which I didn’t discuss broadly here. When we change the Text of TextFie...
k
I’ve observed one more issue which I didn’t discuss broadly here. When we change the Text of TextFieldValue from any external effect, say a button click sets some text value for TextField, this doesn’t change the cursor position. Ideally the cursor should be set to end of the set Text. Is there any way I can handle this programmatically? I’m aware of
OffsetMapping
for
VisualTransformation
but this isn’t available for the use-case I mentioned.
s
Set selection to where you want it to be
k
But that will select the text, I don’t want to select but just to move the cursor, are you suggesting my range should be n-1 to n ?
s
Range is n,n
That will set the cursor position
k
Oh got it.
That worked like a charm. Thanks!
👍 1