Skip to content

With EnsureSemantics(), a Scrollable Widget with Internal Widget with NeverScrollableScrollPhysics Causes Jerky Scrolling #159358

@emma-roudabush-disney

Description

@emma-roudabush-disney

Steps to reproduce

  1. Have a web app with ensureSemantics ran
  2. Have a listview with internal listview
  3. Have the internal listview have NeverScrollableScrollPhysics()
  4. Run web app and scroll

Expected results

Scroll is smooth

Actual results

Scroll jerks around/jumps when scrolling up or down

If ensureSemantics is removed or if GridView or ListView (with NeverScrollableScrollPhysics) is removed or replaced, scroll is smooth.

Code sample

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

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  SemanticsBinding.instance.ensureSemantics();
  runApp(const TestApp());
}

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: TestPage(),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return ListView(
      padding: EdgeInsets.zero,
      children: [
        SizedBox(
          height: 500.0,
          width: 400.0,
          child: ListView(
            scrollDirection: Axis.horizontal,
            physics: const NeverScrollableScrollPhysics(),
            children: [
              Container(color: Colors.red, height: 500, width: 100.0),
              Container(color: Colors.blue, height: 500, width: 100.0),
              Container(color: Colors.green, height: 500, width: 100.0),
            ],
          ),
        ),
        ...List.generate(
          20,
          (index) => ListTile(
            title: Text('Test Item $index'),
            leading: const Icon(Icons.list),
            trailing: const Icon(Icons.arrow_forward),
          ),
        ),
      ],
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
Screen.Recording.2024-11-19.at.4.17.44.PM.mov

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output

Was able to repro on Flutter version 3.24.2 and 3.27.0-0.1.pre
Unable to repro on Flutter version 3.22.2

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: regressionIt was better in the past than it is nowcustomer: castawayf: scrollingViewports, list views, slivers, etc.found in release: 3.27Found to occur in 3.27frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-webOwned by Web platform teamtriaged-webTriaged by Web platform teamworkaround availableThere is a workaround available to overcome the issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions