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
TextField's cursor offset is weired #145884
Comments
Hi @inho1213, I just tested this on stable 3.19.4 with the sample below and I don't see any issues with the cursor position. Can you provide a complete minimal sample with detailed steps to reproduce the issue? Screen.Recording.2024-03-28.at.10.18.23.movsample usedimport 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
useMaterial3: false,
),
home: const MyHomePage(title: 'Scrollbar'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: TextField(
keyboardType: TextInputType.multiline,
textInputAction: TextInputAction.unspecified,
autocorrect: false,
controller: TextEditingController(),
),
),
);
}
} |
Oh! sorry for late. 2024-04-05.5.49.13.movRelated code is like below:
It happened not only dialog but also all places where TextField is used. |
Hi @inho1213, are you using the korean keyboard or does this occur with the english keyboard as well? |
Do you mean that both the korean character and the english character produce this problem? If not, how can I change from the korean keyboard to the english keyboard? |
Hi @inho1213, I was asking what input source you were using. Also, in the video you took, are you running on a desktop client with a small window size or did you run it on a mobile device? If so, which OS? I tried with the english input source and 2-set korean on my mac, but I can't reproduce the issue. Screen.Recording.2024-04-08.at.06.25.20.mov |
Hello again! @danagbemava-nc I used input source like you. (english and 2-set korean) This issue is only on macOS. (My mac book is Apple M1 Max, Sonoma 14.3.) I am also using FlutterWebFrame and ScreenUtilInit. Below is related code snippet:
|
Those packages could be affecting it. Can you try it in a clean flutter app without any third party packages to see if you still experience the issue? |
Thanks! |
Since this is caused by a third-party package, I'll be closing this issue. If you are able to find a flutter only example that reproduces this issue, kindly file a new issue so that it can be properly investigated. Thank you |
Steps to reproduce
I'm using flutter version 3.19.3.
IMHO, TextField has a bug when building widget.
It uses "iOSHorizontalOffset" although target platform is macOS. (1402 line of "material/text_field.dart")
When I remove that line, I can see the expected result.
Expected results
Actual results
Code sample
Screenshots or Video
No response
Logs
No response
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: