Repository: flutter
Issue: Text should remain foused when TextFormField caret position when off TextFormField width
Labels: a: text input,framework,has reproducible steps,P2,found in release: 2.8,found in release: 2.9,team-framework,triaged-framework

## Steps to Reproduce

1. Execute `flutter run` on the code sample
2. Click on text field
3. Click on FAB multiple times

**Expected results:** <!-- what did you want to see? -->
1. Caret is focused just like when editing using keyboard.

**Actual results:** <!-- what did you see? -->
1. Caret is already at the end of the text (need to scroll all the way), but not focused.

<details>
<summary>Code sample</summary>

```dart

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final _textController = TextEditingController();

  void _addText() {
    final newText = '${_textController.value.text}yooooooooooooooooo';
    _textController.value = _textController.value.copyWith(
      text: newText,
      selection: TextSelection.collapsed(offset: newText.length)
    );
  }

  @override
  void dispose() {
    super.dispose();
    _textController.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: SizedBox(
          width: 200,
          child: TextFormField(
            controller: _textController,
            maxLines: 1,
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _addText,
        tooltip: 'Add text',
        child: const Icon(Icons.add),
      ),
    );
  }
}
```

</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.
-->

```
```

<!--
     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. -->

```
[✓] Flutter (Channel stable, 2.8.0, on macOS 12.0.1 21A559 darwin-x64, locale en-GB)
    • Flutter version 2.8.0 at /Users/yusuf/fvm/versions/2.8.0
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision cf44000065 (5 days ago), 2021-12-08 14:06:50 -0800
    • Engine revision 40a99c5951
    • Dart version 2.15.0
```

</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.
-->