0

i recognized a strange thing. When i have 4 digits in an input field and I delete the last digit, the cursor should then be on the third position (|1|2|3|), i.e. after the third digit, I count with 0. I check this with Flutter with Textselection and take the baseOffset to get the cursor position.

Well, THE PROBLEM is, that the baseOffset position differs dependant on the android version!!! In Android 10 the baseOffset ist 4, in Android 11 the baseOffset is 4!! Because of that when I set the cursor with the baseOffset it's on a wrong position only on Android 11, not on Android 10!

Have anyone a solution?

Peter
  • 87
  • 1
  • 6
  • I meant controller.selection to get the cursor position – Peter May 07 '21 at 11:02
  • I see the difference in the versions are the TextAffinity. Android version 10 is TextAffinity=upstream, and Android version 11 is TextAffinity=downstream. But the position should stay the same... – Peter May 07 '21 at 11:55

0 Answers0