Flutter Web TextForm Field

Viewed 296

I need help with my flutter web. I used a Multiline TextFormField but you can only naviagte through the text(move the cursor) using a keyboard. Clicking with the mouse where I want the cursor to go instead takes the cursor to the start of the first line. But the keyboard works just fine.

I understand Flutter web is not yet stable but is there a possible solution for this?

To recreate,

  • just make form and add a textform field with multiline enabled.
  • Type text into it, about three lines, and then try to move the cursor using the mouse to the position you wish.
2 Answers

This is an issue that was brought to the flutter team and they are aware of it. It's most definitely broken, but there is a fix available.

According to this comment linking to this issue, add --dart-define=FLUTTER_WEB_USE_EXPERIMENTAL_CANVAS_TEXT=true to your build/run statement.

Full example:

flutter run -d web-server --release --dart-define=FLUTTER_WEB_USE_EXPERIMENTAL_CANVAS_TEXT=true

The Latest flutter versions did indeed resolve this issue.

Closed.

Related