henryleunghk / flutter-native-text-input

Native text input for Flutter
MIT License
66 stars 50 forks source link

Cursor moves forward to the first character on Android 13 when using TextEditingController on NativeTextInput #44

Closed returnjuwon closed 1 year ago

returnjuwon commented 1 year ago

Expected behavior:

The cursor should move to the next character when typing

Actual behavior:

The cursor moves forward to the first character when typing

Steps to reproduce:

Open the app on an Android 13 device Add a controller (TextEditingController) to a NativeTextInput field Try to type in the NativeTextInput field

Device information:

Android version: 13

returnjuwon commented 1 year ago

Solution: Add the following code in the onchange method:

Copy code _controller.selection = TextSelection.collapsed( offset: _controller.text.length);