ListTile Mouse Pointer Fix (#60563)
This commit is contained in:
@@ -946,7 +946,7 @@ class ListTile extends StatelessWidget {
|
||||
final MouseCursor effectiveMouseCursor = MaterialStateProperty.resolveAs<MouseCursor>(
|
||||
mouseCursor ?? MaterialStateMouseCursor.clickable,
|
||||
<MaterialState>{
|
||||
if (!enabled) MaterialState.disabled,
|
||||
if (!enabled || (onTap == null && onLongPress == null)) MaterialState.disabled,
|
||||
if (selected) MaterialState.selected,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1517,5 +1517,21 @@ void main() {
|
||||
);
|
||||
|
||||
expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
|
||||
|
||||
// Test default cursor when onTap or onLongPress is null
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Material(
|
||||
child: Center(
|
||||
child: MouseRegion(
|
||||
cursor: SystemMouseCursors.forbidden,
|
||||
child: ListTile(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user