Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

[ScrollablePositionedList] iOS screen reader (VoiceOver) doesn't focus on the item in initialScrollIndex #552

@ronny-strath

Description

@ronny-strath

Problem description

I'm using scrollable_positioned_list to render a list of items. When using the iPhone screen reader (VoiceOver) to navigate the app, the screen reader focus doesn't move to the item in initialScrollIndex, but jumps to an earlier item in the list. On Android (TalkBack) it works as expected.

Steps to reproduce

main.dart:

import 'package:flutter/material.dart';
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  List<Widget> contentCards = [];

  @override
  void initState() {
    super.initState();
    for (int i = 0; i < 100; i++) {
      contentCards.add(
        Card(
          child: ListTile(
            title: Text('Item $i'),
          ),
        ),
      );
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: ScrollablePositionedList.builder(
        itemCount: contentCards.length,
        initialScrollIndex: contentCards.indexOf(contentCards[50]),
        itemBuilder: (context, index) {
          return contentCards[index];
        },
      )
    );
  }
}

Expected behavior

VoiceOver focus should go to the item in initialScrollIndex (in this case item #50)

Actual behavior

VoiceOver focus jumps to an earlier item (item #26)

Environment

iPhone 12, iOS version 17.6.1

scrollable_test.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions