-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The TextField could not set the selection state? #62654
Comments
Hi @1169886116 |
same issue...
|
Hi @reazon7 |
in my case,, it's not TextField but TextFormField that has the problem. here's minimal code
this happended after I upgraded flutter version to stable 1.20.1 (in stable 1.17.5 it's fine)...
|
Same happening to me after upgrading to stable 1.20.1 It was working perfectly in stable 1.17.5 |
Same problem. Flutter upgrade broke [Example]:
the offset is always 0(zero), it ignores the 5
Flutter Doctor:
|
Hi @katlehotech |
@pedromassangocode There is complete reproducible code added by @reazon7 9 days ago! |
import 'package:flutter/material.dart'; class TextFieldPage extends StatefulWidget { class _TextFieldPageState extends State { |
Clicking submit cannot set the content to selected mode |
flutter SDK : [✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.6 19G2021, |
The code he shared does not reproduce the actual issue! |
Hi @1169886116 |
Just do a |
Without additional information, we are unfortunately not sure how to resolve this issue. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
//PDA扫描得到的值,取出来处理一下,在赋值给输入框,在设置选中状态无效
onChanged: (str) {
//将输入框的值处理
String newStr = str.split("#").first;
//赋值输入框新值
_controller.text = newStr;
//设置新值的选中状态
_controller.selection = TextSelection(
baseOffset: 0,
extentOffset: numberStr.length,
);
}
The TextField could not set the selection state?
The text was updated successfully, but these errors were encountered: