Skip to content

hitTesting offset when using SliverMainAxisGroup in CustomScrollable(reverse: true) #170999

Closed

Description

@spkersten

Steps to reproduce

When SliverMainAxisGroup is used in a CustomScrollable with reverse: true then the main axis extent of the last child of the SliverMainAxisGroup (incorrectly) offsets hit testing of the other children.

Perhaps related to #170991, #167801 (Logging this separately as I'm not sure and this deserves it's own widget tests)

Please add any fix as a point release to Flutter 3.32.

Expected results

hit testing works correctly.

Actual results

Tapping on the bottom 40dp of the red box does nothing, while tapping above outside of the red box prints "TAP".

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) => Directionality(
    textDirection: TextDirection.ltr,
    child: Padding(
      padding: const EdgeInsets.all(20.0),
      child: CustomScrollView(
        reverse: true,
        slivers: [
          SliverMainAxisGroup(
            slivers: [
              SliverToBoxAdapter(
                child: GestureDetector(
                  onTap: () {
                    print("TAP");
                  },
                  child: Container(color: Color(0xffff0000), height: 60),
                ),
              ),
              SliverToBoxAdapter(child: SizedBox(height: 40)),
            ],
          ),
        ],
      ),
    ),
  );
}

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.32.4, on macOS 15.5 24F74 darwin-arm64, locale en-NL)

Also broken on 3.33.0-1.0.pre.559

Was still working on 3.29.3

Activity

  1. danagbemava-nc commented on Jun 25, 2025

    @danagbemava-nc
    Member

    Reproducible using the code sample provided above.

    Screen.Recording.2025-06-25.at.10.32.29.AM.mov
    flutter doctor -v
    [✓] Flutter (Channel stable, 3.32.4, on macOS 15.5 24F74 darwin-arm64, locale en-US) [885ms]
        • Flutter version 3.32.4 on channel stable at /Users/deanli/dev/stable
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 6fba2447e9 (12 days ago), 2025-06-12 19:03:56 -0700
        • Engine revision 8cd19e509d
        • Dart version 3.8.1
        • DevTools version 2.45.1
    
    
    [!] Flutter (Channel master, 3.33.0-1.0.pre.677, on macOS 15.5 24F74 darwin-arm64, locale en-US) [4.4s]
        • Flutter version 3.33.0-1.0.pre.677 on channel master at /Users/deanli/dev/master
        ! Warning: `flutter` on your path resolves to /Users/deanli/dev/stable/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/deanli/dev/master. Consider adding /Users/deanli/dev/master/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/deanli/dev/stable/bin/dart, which is not inside your current Flutter SDK checkout at /Users/deanli/dev/master. Consider adding /Users/deanli/dev/master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 47c6e40802 (10 hours ago), 2025-06-24 17:16:17 -0700
        • Engine revision 47c6e40802
        • Dart version 3.9.0 (build 3.9.0-268.0.dev)
        • DevTools version 2.48.0-dev.0
    
  2. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    f: scrollingViewports, list views, slivers, etc.
    f: gesturesflutter/packages/flutter/gestures repository.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on Jun 25, 2025
  3. added a commit that references this issue on Jul 10, 2025
    8f34ca2
  4. added a commit that references this issue on Jul 10, 2025
    e0a9429
  5. github-actions commented on Jul 24, 2025

    @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.

  6. locked as resolved and limited conversation to collaborators on Jul 24, 2025
  7. added a commit that references this issue on Jul 28, 2025
    1dfab9c
  8. added a commit that references this issue on Aug 19, 2025
    a43fd05
  9. added a commit that references this issue on Sep 18, 2025
    3986e70
  10. added a commit that references this issue on Nov 21, 2025
    0556978
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

    f: gesturesflutter/packages/flutter/gestures repository.f: scrollingViewports, list views, slivers, etc.found in release: 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33frameworkflutter/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-frameworkOwned by Framework team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions