问题:
有复制时
flutter-输入框空白长按不弹出选项
解决:

参考:

void _handleSelectionChange(
TextSelection nextSelection,
SelectionChangedCause cause,
) {
// Changes made by the keyboard can sometimes be "out of band" for listening
// components, so always send those events, even if we didn t think it
// changed. Also, focusing an empty field is sent as a selection change even
// if the selection offset didn t change.
final bool focusingEmpty = nextSelection.baseOffset == 0 && nextSelection.extentOffset == 0 && !hasFocus;
//原生代码
// if (nextSelection == selection && cause != SelectionChangedCause.keyboard && !focusingEmpty) {
// return;
// }
//修改后代码
if (nextSelection == selection && nextSelection.end - nextSelection.start > 0) {
return;
}
if (onSelectionChanged != null) {
onSelectionChanged!(nextSelection, this, cause);
}
}
© 版权声明
文章版权归作者所有,未经允许请勿转载。如内容涉嫌侵权,请在本页底部进入<联系我们>进行举报投诉!
THE END

















- 最新
- 最热
只看作者