Open
Description
Setting backgroundColor
on TextField
appears to mask cursor and text selection. That is when you type some text in a text box and move cursor back it disappears. Selecting text doesn't show any visual indicator of a selection either.
Below is a code to reproduce this.
I observe this behavior at least on linux and android.
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: TextField(
style: new TextStyle(backgroundColor: Colors.yellow),
),
),
);
}
}
https://dartpad.dev/?id=c76c8bd3543de7eeea64cd6d0b225835 <== you can test it here
Metadata
Metadata
Assignees
Labels
Entering text in a text field or keyboard related problemsflutter/packages/flutter/material repository.Found to occur in 2.8Found to occur in 2.9flutter/packages/flutter repository. See also f: labels.The issue has been confirmed reproducible and is ready to work onOwned by Design Languages teamTriaged by Design Languages team