Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Scrollbar hittest penetration issue #99324

Closed
@xu-baolin

Description

@xu-baolin

Code

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      scrollBehavior: MyScrollBehavior(),
      home: Scaffold(
        body: Center(
          child: SizedBox(
            width: 200,
            height: 200,
            child: Scrollbar(
              // interactive: false,
              thumbVisibility: true,
              trackVisibility: true,
              child: SingleChildScrollView(
                child: GestureDetector(
                  onTap: () => print('onTap'),
                  child: const FlutterLogo(
                    size: 300,
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}

class MyScrollBehavior extends ScrollBehavior {

  @override
  Widget buildScrollbar(BuildContext context, Widget child, ScrollableDetails details) {
    return child;
  }
}

Expect

Do not output onTap log if tap the track rectangle area.

Actual

Output onTap log if tap on the scrollbar track area.

Metadata

Metadata

Assignees

No one assigned

    Labels

    f: scrollingViewports, list views, slivers, etc.found in release: 2.11Found to occur in 2.11frameworkflutter/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 version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions