Repository: flutter
Issue: Typing with Pinyin-Simplified Input Source while selecting text, the navigation box is positioned incorrectly
Labels: a: text input,platform-mac,a: internationalization,a: desktop,has reproducible steps,P2,found in release: 3.13,found in release: 3.16,team-macos,triaged-macos

### 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 macOS
2. Copy a large text and paste it into the TextField
3. Select a few lines of text
4. Switch Input Source to Pinyin - Simplified
5. Type nihao

See the attached video and screenshots.

### Expected results

The Input Source navigation box should be below the typing text.

### Actual results

Wrong position.

### Code sample

<details><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: Scaffold(
        appBar: AppBar(
          backgroundColor: Theme.of(context).colorScheme.inversePrimary,
          title: const Text('Title'),
        ),
        body: const Center(
          child: TextField(
            maxLines: null,
          ),
        ),
      ),
    );
  }
}

```

</details>


### Screenshots or Video

<details>
<summary>Video</summary>


https://github.com/flutter/flutter/assets/5484841/5f27fe3d-7453-4fa3-b92f-6ee7db82de9d



</details>

<details>
<summary>Screenshots</summary>
<img width="800" alt="image" src="https://github.com/flutter/flutter/assets/5484841/dcf3c719-8266-4cfd-a7d0-301edd7c3171">


<img width="800" alt="image" src="https://github.com/flutter/flutter/assets/5484841/77fa2aa2-fd79-442a-ace2-7fff04f66ffb">


</details>


### Logs

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


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
➜  ~ flutter doctor -v
[✓] Flutter (Channel stable, 3.13.9, on macOS 13.0.1 22A400 darwin-x64, locale en-CN)
    • Flutter version 3.13.9 on channel stable at /Users/fan/.fvm/versions/3.13.9
    • Upstream repository git@github.com:flutter/flutter.git
    • Framework revision d211f42860 (7 days ago), 2023-10-25 13:42:25 -0700
    • Engine revision 0545f8705d
    • Dart version 3.1.5
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/fan/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /Applications/Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.83.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.74.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 13.0.1 22A400 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 113.0.5672.126

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>