Repository: flutter
Issue: Autocomplete options view getting lost
Labels: a: text input,framework,f: scrolling,f: focus,has reproducible steps,P2,found in release: 3.19,team-text-input,triaged-text-input,found in release: 3.21

### Steps to reproduce

I took the example from [autocomplete docs](https://api.flutter.dev/flutter/material/Autocomplete-class.html) and simply added more options.

Running the following code then, on a PC type the letter "t" in the text field and press the down key on the keyboard until the last one is reached.

Then press it once again and it circles to the first one but it doesn't scroll to it. If you keep the down key pressed it eventually reaches the button again and you can see the "focus" moving. I assume it's something to do with "ensureVisible" but not sure why it happens.


### Expected results

when reaching the last one then pressing the down key once more, it should bring the focused option in view

### Actual results

when reaching the last one then pressing the down key once more, it keeps showing the bottom of the options

### Code sample

<details open><summary>Code sample</summary>


```dart
import 'package:flutter/material.dart';

/// Flutter code sample for [Autocomplete].

void main() => runApp(const AutocompleteExampleApp());

class AutocompleteExampleApp extends StatelessWidget {
  const AutocompleteExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Autocomplete Basic'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                  'Type below to autocomplete the following possible results: ${AutocompleteBasicExample._kOptions}.'),
              const AutocompleteBasicExample(),
            ],
          ),
        ),
      ),
    );
  }
}

class AutocompleteBasicExample extends StatelessWidget {
  const AutocompleteBasicExample({super.key});

  static List<String> _kOptions = List.generate(10, (index) => 'test $index');

  @override
  Widget build(BuildContext context) {
    return Autocomplete<String>(
      optionsBuilder: (TextEditingValue textEditingValue) {
        if (textEditingValue.text == '') {
          return const Iterable<String>.empty();
        }
        return _kOptions.where((String option) {
          return option.contains(textEditingValue.text.toLowerCase());
        });
      },
      onSelected: (String selection) {
        debugPrint('You just selected $selection');
      },
    );
  }
}
```

</details>


### Screenshots or Video

_No response_

### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[√] Flutter (Channel stable, 3.19.4, on Microsoft Windows [Version 10.0.22000.2538], locale el-GR)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc2)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.6.4)
[√] Android Studio (version 2023.2)
[√] Connected device (3 available)
[√] Network resources

• No issues found!

```

</details>