-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: mouseIssues related to using a mouse or mouse supportIssues related to using a mouse or mouse supportf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
inactive-listtile-keeps-hover.mov
Steps to Reproduce
(I tried in web)
- Execute
flutter runon the code sample - Click on unselected item (and keep mouse cursor on it)
Expected results:
The ListTile immediately becomes inactive. Without any hover state and with its default background.
Actual results:
The ListTile keeps some kind of hover state (with different background color) until mouse cursor leaves it.
By the way, mouse cursor type depends on active/inactive state of the ListTile and switches correctly.
Code sample
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
int selectedIndex = 0;
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: ListView(
children: ['Title 1', 'Title 2']
.asMap()
.entries
.map((entry) => ListTile(
title: Text(entry.value),
subtitle: Text(
entry.key == selectedIndex ? 'is selected' : 'sub'),
onTap: entry.key == selectedIndex
? null
: () {
setState(() {
selectedIndex = entry.key;
});
},
))
.toList(),
),
),
);
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: mouseIssues related to using a mouse or mouse supportIssues related to using a mouse or mouse supportf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Type
Projects
Status
Done (PR merged)