-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Closed
Description
Intro
This is related to the fact that currently there is no reliable way to distinguish mouse / trackpad scroll events on the web:
- Differentiate trackpad from mouse wheels on web #139990
- Web trackpad pan engine#36346
- Wheel event: determine difference between trackpad and mouse events w3c/uievents#337
Therefore on Firefox or on some OS trackpad events are registered as mouse events.
Steps to reproduce
- Have an
InteractiveViewer
widget in a project withtrackpadScrollCausesScale
field set to false. - Open the project in Firefox, or on other browsers on windows / linux.
- Scroll with a trackpad on top of it.
Expected results
The InteractiveViewer
child is not scaled.
Actual results
The InteractiveViewer
child is scaled.
Code sample
Code sample
import '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 Demo',
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(title),
),
body: Center(
child: SizedBox.square(
dimension: 300,
child: InteractiveViewer(
trackpadScrollCausesScale: false,
child: Placeholder(),
),
),
),
);
}
}
Screenshots or Video
No response
Logs
Flutter Doctor output
Doctor output
[cloud@psi ~]$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.1, on Arch Linux 6.13.3-arch1-1, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2024.2)
[✓] IntelliJ IDEA Community Edition (version 2024.3)
[✓] Connected device (2 available)
Metadata
Metadata
Assignees
Labels
No labels