Repository: flutter
Issue: SDK 3.24.0 TextField becomes focused on navigator back (pop) action
Labels: a: text input,framework,f: scrolling,has reproducible steps,P2,workaround available,team-text-input,triaged-text-input,found in release: 3.24

### Steps to reproduce

1. Run app the app, I did test on real device, iPhone 13
2. press on text field to open keyboard
3. scroll list to close keyboard
4. open dialog by pressing plus icon
5. close dialog by pressing close button or press at dismiss area
6. boom, you returned to previous page, keyboard appearing, text field again focused, but shouldn't...

### Expected results

You return to page with scrolled list with no keyboard opened.



### Actual results

Text field is focused and keyboard appearing



### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @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> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
        actions: [
          IconButton(
            onPressed: () {
              showDialog(
                context: context,
                builder: (context) {
                  return Center(
                    child: SizedBox(
                      height: 300,
                      child: Scaffold(
                        backgroundColor: Colors.grey,
                        body: Column(
                          children: [
                            const Row(
                              children: [
                                Text(
                                  'some text',
                                  style: TextStyle(),
                                ),
                              ],
                            ),
                            const Spacer(),
                            TextButton(
                              onPressed: () {
                                Navigator.of(context).pop();
                              },
                              child: const Text('Close'),
                            ),
                          ],
                        ),
                      ),
                    ),
                  );
                },
              );
            },
            icon: const Icon(Icons.add),
          ),
        ],
      ),
      body: Column(
        children: [
          const TextField(),
          Expanded(
            child: ListView(
              keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
              children: List.generate(
                45,
                (index) => ListTile(
                  title: Text('index: $index'),
                ),
              ),
            ),
          )
        ],
      ),
    );
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

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


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-arm64, locale en-UA)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.83.1)
[✓] Connected device (4 available)
[✓] Network resources
```

</details>