Repository: flutter
Issue: CustomScrollView has scroll initialized by TextField in SliverPersistentHeader
Labels: a: text input,framework,f: scrolling,has reproducible steps,P2,found in release: 3.10,found in release: 3.12,team-framework,triaged-framework

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

1. Use SliverPersistentHeaderDelegate which has TextField or TextFormField as child in SliverPersistentHeader inside CustomScrollView.
2. Set the floating of the SliverPersistentHeader to true.
3. Scroll down to hide the header.
4. Scroll up slightly to see the header.
5. Scrolling is initialized when the TextField in the header is clicked.

### Expected results

The scroll position should be maintained.

### Actual results

When the focus is moved by clicking on the TextField, the scroll position is initialized.

### Code sample

<details><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() async {
  runApp(const TestWidget());
}

class TestWidget extends StatefulWidget {
  const TestWidget({super.key});

  @override
  TestWidgetState createState() => TestWidgetState();
}

class TestWidgetState extends State<TestWidget> {
  final List<Widget> _items = List.generate(40, (index) {
    return Container(
      width: 200,
      height: 200,
      decoration: BoxDecoration(
        border: Border.all(
          color: Colors.black,
          width: 1,
        ),
      ),
      child: Center(
        child: Text('Image ${index + 1}'),
      ),
    );
  });

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: CustomScrollView(
          slivers: [
            SliverPersistentHeader(
              floating: true,
              delegate: _DynamicHeader(),
            ),
            SliverList(
              delegate: SliverChildListDelegate(_items),
            ),
          ],
        ),
      ),
    );
  }
}

class _DynamicHeader extends SliverPersistentHeaderDelegate {
  @override
  Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
    return const DecoratedBox(
      decoration: BoxDecoration(
        color: Colors.red,
      ),
      child: Column(
        children: [
          TextField(),
        ],
      ),
    );
  }

  @override
  bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) => true;

  @override
  double get maxExtent => 100;

  @override
  double get minExtent => 100;
}

```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>



https://github.com/flutter/flutter/assets/75677950/7b332677-320a-4e8c-b870-d49b5c819502


</details>


### Logs

<details><summary>Logs</summary>

```console
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 3.12.0-14.0.pre.30, on Microsoft Windows [Version 10.0.22621.1848], locale ko-KR)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.2.3)
[√] Android Studio (version 2022.2)
[√] VS Code (version 1.80.0)
[√] Connected device (3 available)
[√] Network resources

• No issues found!
```

</details>