Repository: flutter
Issue: Focusing to a TextField inside a NestedScrollView with pinned SliverAppBar scrolls to top
Labels: framework,f: scrolling,a: desktop,has reproducible steps,P2,found in release: 3.0,found in release: 3.1,team-framework,triaged-framework

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Execute `flutter run` on the code sample <!-- (see "Code sample" section below) -->
2. Tap on the TextField

in the actual project the ListView under body of NestedScrollView is wrapped inside a TabBarView so I can't just use SliverList.

**Expected results:** <!-- what did you want to see? -->

https://user-images.githubusercontent.com/21140798/177035117-e7bce32b-7a61-4f10-9f48-226977a067fa.mp4

**Actual results:**

https://user-images.githubusercontent.com/21140798/177035125-43d7db8d-cf9a-4f4e-b762-ab311d1ae79a.mp4

 <!-- what did you see? -->

<details>
<summary>Code sample</summary>

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->

```dart
class TestPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Theme.of(context).colorScheme.surface,
        body: NestedScrollView(
          headerSliverBuilder: (context, innerBoxIsScrolled) => [
            SliverAppBar(
              title: Text('TestPage'),
              floating: false,
              pinned: true,
            ),
          ],
          body: ListView(
            children: [
              const TextField(autofocus: false),
              for (var i = 1; i <= 100; i++) ListTile(title: Text('Tile $i')),
            ],
          ),
        ),
    );
  }
}
```

</details>

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue. If there is a crash, please include
      the entirety of the crash log including the backtrace.
-->

```
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->