Skip to content

[A11y] Double Tap brings the Slider thumb to the center of the widget.  #156427

@dsanagustin

Description

@dsanagustin

Steps to reproduce

  1. Turn on Android TalkBack or iOS VoiceOver.
  2. Load the simple app with one Flutter Slider.
  3. Try double tapping on a tick.

Expected results

Double tapping a tick should move the slider indicator to that tick.

Actual results

If the indicator is off-center, the indicator will return to center after a double tap.

From my own research, I believe this could be related to how GestureDetectors and GestureRecognizers work when accessibility mode is on.

Code sample

Code sample
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  MyApp();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Slider A11Y Demo',
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(title)),
      body: MySlider(),
    );
  }
}

class MySlider extends StatefulWidget {
  MySlider({Key? key}) : super(key: key);

  @override
  State createState() => _MySliderState();
}

class _MySliderState extends State<MySlider> {
  double _currentSliderValue = 50.0;

  void _onChanged(double value) {
    setState(() {
      _currentSliderValue = value;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Slider(
      value: _currentSliderValue,
      min: -100,
      max: 100,
      divisions: 8,
      label: 'Current Value: $_currentSliderValue',
      onChanged: _onChanged,
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

https://youtube.com/shorts/VovzhuLa27s

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
$ fg3 doctor -v
[   +2 ms] ProcessManager.runSync('which java')
[   +5 ms] executing: /usr/local/buildtools/java/jdk/bin/java --version
[   +1 ms] ProcessManager.runSync('/usr/local/buildtools/java/jdk/bin/java --version')
[  +38 ms] Exit code 0 from: /usr/local/buildtools/java/jdk/bin/java --version
[   +1 ms] openjdk 23 2024-10-02
           OpenJDK Runtime Environment (build 23+-google-release-sts-681679659)
           OpenJDK 64-Bit Server VM (build 23+-google-release-sts-681679659, mixed mode, sharing)
[   +1 ms] executing: /usr/bin/adb devices -l
[   +1 ms] ProcessManager.run('/usr/bin/adb devices -l')
[   +1 ms] Gallium device polling: connecting to galliumd.
[   +1 ms] [✓] Flutter (Channel google3, on Debian GNU/Linux rodete 6.9.10-1rodete5-amd64, locale en_US.UTF-8)
[   +1 ms]     • Framework revision 621e7ef951 (13 days ago), 2024-09-25T00:00:00.000
[   +1 ms]     • Engine revision d6d5fdba6a
[   +1 ms]     • Dart version dd73afd20b
[   +1 ms] [✓] Android toolchain - develop for Android devices (Android SDK version Stable)
[   +1 ms]     • Android SDK at google3
[   +1 ms]     • Platform Stable, build-tools Stable
[   +1 ms]     • Java binary at: /usr/local/buildtools/java/jdk/bin/java
[   +1 ms]     • Java version OpenJDK Runtime Environment (build 23+-google-release-sts-681679659)
[   +1 ms] [✓] VS Code (version 1.87.1)
[   +1 ms]     • VS Code at /usr/share/code
[   +1 ms]     • Flutter extension can be installed from:
[   +1 ms]       🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[  +43 ms] List of devices attached
           localhost:38637        device product:oriole model:Pixel_6 device:oriole transport_id:5
[   +2 ms] Gallium device polling failed to connect to galliumd: gRPC Error (code: 14, codeName: UNAVAILABLE, message: Error connecting: SocketException: Connection refused (OS Error: Connection refused, errno = 111),
address = localhost, port = 46084, details: null, rawResponse: null, trailers: {})
[   +1 ms] /usr/bin/adb -s localhost:38637 shell getprop
[   +1 ms] ProcessManager.run('/usr/bin/adb -s localhost:38637 shell getprop')
[ +164 ms] ro.hardware = oriole
[   +2 ms] ro.build.characteristics = nosdcard
[   +1 ms] executing: uname -m
[   +1 ms] ProcessManager.runSync('uname -m')
[   +3 ms] Exit code 0 from: uname -m
[   +1 ms] x86_64
[   +1 ms] executing: /usr/bin/adb devices -l
[   +1 ms] ProcessManager.run('/usr/bin/adb devices -l')
[   +3 ms] List of devices attached
           localhost:38637        device product:oriole model:Pixel_6 device:oriole transport_id:5
[   +2 ms] [✓] Connected device (2 available)
[   +1 ms]     • Pixel 6 (mobile) • localhost:38637 • android-arm64 • Android 15 (API 35)
[   +1 ms]     • Linux (desktop)  • linux           • linux-x64     • Debian GNU/Linux rodete 6.9.10-1rodete5-amd64
[   +1 ms] [✓] Google3 (on linux)
[   +1 ms]     • KVM enabled
[   +1 ms] • No issues found!
[   +1 ms] "flutter doctor" took 306ms.
[ +646 ms] ensureAnalyticsSent: 645ms
[   +2 ms] Running 1 shutdown hook
[   +1 ms] Shutdown hooks complete
[   +1 ms] exiting with code 0

Internal Bug ID

b/364625445

Metadata

Metadata

Assignees

Labels

a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)f: material designflutter/packages/flutter/material repository.found in release: 3.24Found to occur in 3.24found in release: 3.26Found to occur in 3.26frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages team

Type

No type

Projects

Status

Done (PR merged)

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions