Repository: flutter
Issue: `Autocomplete` don't hide options when `keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag` on desktop
Labels: a: text input,framework,f: scrolling,a: desktop,has reproducible steps,P2,workaround available,team-design,triaged-design,fyi-text-input,found in release: 3.22,found in release: 3.23

### Steps to reproduce

1. Run the minimal reproducible sample in web/android

### Expected results

The options list should be hidden when scrolling.

**It works fine on Android, but not on the web.**

### Actual results

`Autocomplete` keeps showing the options list

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

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'),
        ),
        body: SingleChildScrollView(
          keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              ...List.generate(
                10,
                (index) => Text(index.toString()),
              ),
              Autocomplete<String>(
                optionsBuilder: (TextEditingValue textEditingValue) {
                  return [
                    'aardvark',
                    'bobcat',
                    'chameleon',
                  ];
                },
              ),
              ...List.generate(
                30,
                (index) => Text(index.toString()),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Mobile</summary>

[Screencast from 11-06-24 11:40:28.webm](https://github.com/flutter/flutter/assets/124096434/0a269736-d950-4d42-abdf-a8eb6f3bc5cf)

</details>

<details open>
<summary>Web</summary>

[Screencast from 11-06-24 11:43:15.webm](https://github.com/flutter/flutter/assets/124096434/8fc2a6bb-9711-4b59-9b1f-86fffa1db561)


</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output master/stable</summary>

**master**

```console
[✓] Flutter (Channel master, 3.23.0-13.0.pre.168, on Ubuntu 22.04.4 LTS 6.5.0-35-generic, locale en_US.UTF-8)
    • Flutter version 3.23.0-13.0.pre.168 on channel master at /home/user/fvm/versions/master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 32081aab69 (3 days ago), 2024-06-08 10:35:21 -0700
    • Engine revision 1cdbebee19
    • Dart version 3.5.0 (build 3.5.0-236.0.dev)
    • DevTools version 2.36.0

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /../
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /home/user/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✗] Linux toolchain - develop for Linux desktop
    ✗ clang++ is required for Linux development.
      It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from https://releases.llvm.org/
    ✗ CMake is required for Linux development.
      It is likely available from your distribution (e.g.: apt install cmake), or can be downloaded from https://cmake.org/download/
    ✗ ninja is required for Linux development.
      It is likely available from your distribution (e.g.: apt install ninja-build), or can be downloaded from
      https://github.com/ninja-build/ninja/releases
    ✗ pkg-config is required for Linux development.
      It is likely available from your distribution (e.g.: apt install pkg-config), or can be downloaded from
      https://www.freedesktop.org/wiki/Software/pkg-config/

[✓] Android Studio (version 2023.3)
    • Android Studio at /home/user/android-studio/
    • Flutter plugin version 79.0.2
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /home/user/android-studio/
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[!] Android Studio (version unknown)
    • Android Studio at /home/user/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to determine Android Studio version.
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.90.0)
    • VS Code at /usr/share/code
    • Flutter extension version 3.86.0

[✓] Connected device (3 available)
    • Android SDK built for x86 64 (mobile) • emulator-5554 • android-x64    • Android 6.0 (API 23) (emulator)
    • Linux (desktop)                       • linux         • linux-x64      • Ubuntu 22.04.4 LTS 6.5.0-35-generic
    • Chrome (web)                          • chrome        • web-javascript • Google Chrome 125.0.6422.141

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.
```

**stable**
```console

[✓] Flutter (Channel stable, 3.22.0, on Ubuntu 22.04.4 LTS 6.5.0-35-generic, locale en_US.UTF-8)
    • Flutter version 3.22.0 on channel stable at /home/user/fvm/versions/3.22.0
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (5 weeks ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at //
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /home/user/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✗] Linux toolchain - develop for Linux desktop
    ✗ clang++ is required for Linux development.
      It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from https://releases.llvm.org/
    ✗ CMake is required for Linux development.
      It is likely available from your distribution (e.g.: apt install cmake), or can be downloaded from https://cmake.org/download/
    ✗ ninja is required for Linux development.
      It is likely available from your distribution (e.g.: apt install ninja-build), or can be downloaded from
      https://github.com/ninja-build/ninja/releases
    ✗ pkg-config is required for Linux development.
      It is likely available from your distribution (e.g.: apt install pkg-config), or can be downloaded from
      https://www.freedesktop.org/wiki/Software/pkg-config/

[✓] Android Studio (version 2023.3)
    • Android Studio at /home/user/android-studio/
    • Flutter plugin version 79.0.2
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /home/user/android-studio/
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[!] Android Studio (version unknown)
    • Android Studio at /home/user/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to determine Android Studio version.
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.90.0)
    • VS Code at /usr/share/code
    • Flutter extension version 3.86.0

[✓] Connected device (3 available)
    • Android SDK built for x86 64 (mobile) • emulator-5554 • android-x64    • Android 6.0 (API 23) (emulator)
    • Linux (desktop)                       • linux         • linux-x64      • Ubuntu 22.04.4 LTS 6.5.0-35-generic
    • Chrome (web)                          • chrome        • web-javascript • Google Chrome 125.0.6422.141

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.

```

</details>