-
Notifications
You must be signed in to change notification settings - Fork 28.5k
[Cupertino]: Can't align placeholder of CupertinoTextField with min lines to top #138794
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
Comments
Thanks for filing this. |
Hello @dam-ease, i tried, but it not works for my, thx. |
Thanks for your response. Code Sample Used
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
TextEditingController commentController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey,
body: SafeArea(
child: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: CupertinoTextField(
minLines: 5,
maxLines: 8,
textAlignVertical: TextAlignVertical.top,
controller: commentController,
keyboardType: TextInputType.multiline,
textInputAction: TextInputAction.done,
placeholder: "textCommentForOnlyPersonal",
),
),
),
),
);
}
}
stable, master flutter doctor -v
|
The placeholder should be baseline-aligned with the text, right now it has to be center-aligned to avoid running into some existing asserts during intrinsic size calculation. I'm working on a fix. |
same issue! |
What's frustrating is that it was working and all of a sudden broke. In the mean time, a workaround is to add newlines to the placeholder |
It's bad variant. Any news about this issue? |
Same issue here, any progress on this 🙂? |
maybe you can try it. |
I think you can change |
No. |
almost 1 year... |
TextField placeholder position is broken without a fix for this... |
Any progress on this? |
SizedBox(
height: 100,
child: CupertinoTextField(
maxLines: 6,
minLines: 1,
placeholder: 'Placeholder text will appear here...',
controller: _textController,
keyboardType: TextInputType.multiline,
textAlignVertical: TextAlignVertical.top,
style: TextStyle(fontSize: 14),
),
) It works for me. |
Any progress on this? |
Yes. U can try use |
Same for me, nothing above helped 😔 |
A bit of a hacky fix, but you can add a bit of padding inside and it works |
Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: