Skip to content

RangeSlider thumb overlay remains visible after touch interaction ends on mobile #189205

Closed
flutter/packages
#12560

Description

@koodimetsa

Steps to reproduce

  1. Run the code sample on Android or iOS.
  2. Drag either RangeSlider thumb.
  3. Lift your finger.
  4. Observe that the circular highlight remains around the thumb.

This appears related to PR #182185, which makes the selected RangeSlider thumb request keyboard focus during pointer interaction. The focus is retained after a touch gesture, and RangeSlider paints an overlay for the focused thumb.

Expected results

The pressed/dragged overlay should disappear when a touch gesture ends.
Keyboard navigation should still display an appropriate focus indicator when focus was obtained through keyboard navigation.

Actual results

The touched thumb retains focus and its overlay remains visible until focus is moved by another interaction.

Code sample

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

void main() {
  runApp(const ExampleApp());
}

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(useMaterial3: true),
      home: const RangeSliderExample(),
    );
  }
}

class RangeSliderExample extends StatefulWidget {
  const RangeSliderExample({super.key});

  @override
  State<RangeSliderExample> createState() => _RangeSliderExampleState();
}

class _RangeSliderExampleState extends State<RangeSliderExample> {
  RangeValues values = const RangeValues(3, 7);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('RangeSlider focus overlay')),
      body: Padding(
        padding: const EdgeInsets.all(24),
        child: Column(
          mainAxisAlignment: .center,
          children: [
            const Text(
              'Drag a thumb and lift your finger. '
              'The overlay remains until focus moves elsewhere.',
              textAlign: .center,
            ),
            const SizedBox(height: 24),
            const TextField(
              decoration: InputDecoration(
                border: OutlineInputBorder(),
                labelText: 'Tap here to move focus',
              ),
            ),
            const SizedBox(height: 24),
            SliderTheme(
              data: SliderTheme.of(
                context,
              ).copyWith(overlayColor: Colors.red.withValues(alpha: 0.25)),
              child: RangeSlider(
                values: values,
                min: 0,
                max: 10,
                divisions: 10,
                labels: RangeLabels(
                  values.start.round().toString(),
                  values.end.round().toString(),
                ),
                onChanged: (newValues) {
                  setState(() {
                    values = newValues;
                  });
                },
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Screenshots or Video

Simulator.Screen.Recording.-.iPhone.17.-.2026-07-10.at.12.27.35.mov

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.44.5, on macOS 26.5.2 25F84 darwin-arm64, locale en-US) [466ms]
    • Flutter version 3.44.5 on channel stable at /Users/xxx/Coding/flutter/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f94f4fc76b (3 days ago), 2026-07-06 11:19:24 -0700
    • Engine revision 83675ed276
    • Dart version 3.12.2
    • DevTools version 2.57.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets,
      enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1,701ms]
    • Android SDK at /Users/xxx/Library/Android/sdk
    • Emulator version 36.6.11.0 (build_id 15507667) (CL:N/A)
    • Platform android-36, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.10+-117844308-b1163.108)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.6) [1,849ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17F113
    • CocoaPods version 1.17.0

[✓] Chrome - develop for the web [5ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (5 available) [6.2s]
    • Iphone17Pro (wireless) (mobile) • 00008150-000E59C02E61401C            • ios            • iOS 26.5.2 23F84
    • Telkkä1 (wireless) (mobile)     • 00008110-000279691122801E            • ios            • iOS 26.5.2 23F84
    • iPhone 17 (mobile)              • 818AB84A-6C97-4E25-9D7C-246792E9F304 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-26-5 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 26.5.2 25F84 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 150.0.7871.115
    ! Error: Browsing on the local area network for GoldenEye. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this
      Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources [256ms]
    • All expected network resources are available.

• No issues found!

Activity

  1. suryaKommana2662 commented on Jul 10, 2026

    @suryaKommana2662

    @koodimetsa Thanks for the detailed report and the reproducible sample. I tested the sample on Android(Motorola) and observed that after dragging a RangeSlider thumb and releasing it, the overlay remains visible. In my testing, the overlay also remained visible after tapping on an empty area outside the slider, which seems slightly different from the behavior described in the report.

    Could you please share a short screen recording demonstrating the behavior you're seeing? That will help verify whether I'm observing the same issue before routing it to the appropriate team.

    Flutter Doctor Output

    [√] Flutter (Channel stable, 3.44.6, on Microsoft Windows [Version 10.0.26200.8655], locale en-IN) [571ms]
        • Flutter version 3.44.6 on channel stable at C:\flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision ee80f08bbf (34 hours ago), 2026-07-08 15:02:06 -0700
        • Engine revision 83675ed276
        • Dart version 3.12.2
        • DevTools version 2.57.0
        • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
          cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging,
          enable-uiscene-migration
    
    [√] Windows Version (Windows 11 or higher, 25H2, 2009) [1,462ms]
    
    [√] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [4.9s]
        • Android SDK at C:\Android\Sdk
        • Emulator version 36.5.11.0 (build_id 15261927) (CL:N/A)
        • Platform android-36.1, build-tools 36.1.0
        • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
          This is the JDK bundled with the latest Android Studio installation on this machine.
          To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
        • Java version OpenJDK Runtime Environment (build 21.0.10+-14961533-b1163.108)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web [207ms]
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [√] Visual Studio - develop Windows apps (Visual Studio Community 2026 18.6.1) [205ms]
        • Visual Studio at C:\Program Files\Microsoft Visual Studio\18\Community
        • Visual Studio Community 2026 version 18.6.11819.183
        • Windows 10 SDK version 10.0.26100.0
    
    [√] Connected device (4 available) [781ms]
        • motorola edge 40 neo (mobile) • ZD222K8SW3 • android-arm64  • Android 15 (API 35)
        • Windows (desktop)             • windows    • windows-x64    • Microsoft Windows [Version 10.0.26200.8655]
        • Chrome (web)                  • chrome     • web-javascript • Google Chrome 150.0.7871.101
        • Edge (web)                    • edge       • web-javascript • Microsoft Edge 149.0.4022.80
    
    [√] Network resources [1,484ms]
        • All expected network resources are available.
    
    • No issues found!
  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    and removed
    in triagePresently being triaged by the triage team
    on Jul 10, 2026
  3. koodimetsa commented on Jul 10, 2026

    @koodimetsa
    Author

    @suryaKommana2662
    Sorry, my wording/example was partial. Edited the code and added a video where there is textfield to move the focus to. In my original code background also had tap listener, which is not the case in the sample code.

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 10, 2026
  5. suryaKommana2662 commented on Jul 10, 2026

    @suryaKommana2662

    @koodimetsa Thanks for updating the sample and adding the screen recording. I was able to reproduce the issue on Android using the updated sample. After dragging a RangeSlider thumb and releasing it, the thumb retains focus and its overlay remains visible until focus is moved to another focusable widget (such as the TextField). I'm routing this to the team-design for further investigation.

  6. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on Jul 10, 2026
  7. added
    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)
    triaged-designTriaged by Design Languages team
    P2Important issues not at the top of the work list
    f: focusFocus traversal, gaining or losing focus
    f: gesturesflutter/packages/flutter/gestures repository.
    on Jul 15, 2026
  8. KarthikManikuttan commented on Jul 16, 2026

    @KarthikManikuttan

    @suryaKommana2662 @Piinks I would like to work on this issue.

  9. Bhootna8 commented on Jul 16, 2026

    @Bhootna8

    @suryaKommana2662 @Piinks I'd like to work on this. I've reproduced the issue on Android. Planning to fix by tracking the pointer device kind on PointerDownEvent in the render object, and calling unfocus() on the active thumb's FocusNode inside _endInteraction() when the gesture originated from a touch or stylus — so focus is cleared on touch release while keyboard-acquired focus is preserved.

  10. KarthikManikuttan commented on Jul 16, 2026

    @KarthikManikuttan

    @suryaKommana2662 @Piinks

    Given the active Material/Cupertino freeze, is this RangeSlider regression fix something maintainers would consider for override code freeze, or should I expect this PR to wait until the Material decoupling path is ready?

    I understand this may not meet the bar for an override, and I’m happy to keep it open for discussion or port it later if that’s preferred.

  11. navaronbracke commented on Jul 17, 2026

    @navaronbracke
    Contributor

    @suryaKommana2662 @Piinks

    Given the active Material/Cupertino freeze, is this RangeSlider regression fix something maintainers would consider for override code freeze, or should I expect this PR to wait until the Material decoupling path is ready?

    I understand this may not meet the bar for an override, and I’m happy to keep it open for discussion or port it later if that’s preferred.

    Yes this will need to be ported to material_ui

  12. Piinks commented on Jul 20, 2026

    @Piinks
    Contributor

    Just to be clear, please do not open PRs in material_ui right now. It is not ready to accept contributions yet.
    We can review the changes here and then we will provide instructions for porting them over to the new packages when ready. It looks like there are 2 PRs open?

  13. KarthikManikuttan commented on Jul 20, 2026

    @KarthikManikuttan

    @Piinks Yes i opened one PR , please review the update as possible.

  14. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
  15. github-actions commented on Sep 7, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  16. locked as resolved and limited conversation to collaborators on Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)f: focusFocus traversal, gaining or losing focusf: gesturesflutter/packages/flutter/gestures repository.p: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions