Repository: flutter
Issue: [web] The text cursor/caret in a TextField does not visually move in Firefox when an arrow key is held pressed
Labels: a: text input,a: fidelity,platform-web,has reproducible steps,browser: firefox,P2,team-web,triaged-web,found in release: 3.24,found in release: 3.27

### Steps to reproduce

In a Flutter web app running in Firefox on desktop (with a physical keyboard):
1. Type some text in a `TextField`.
2. Press _and hold_ the `<left>` arrow key (assuming LTR text) to move the text cursor/caret backwards.

### Expected results

The text cursor should move backwards/to the left, through the sequence of characters in the `TextField`.

### Actual results

The text cursor keeps flashing in the position it was in, until you release the arrow key, at which point the cursor shows up at the correct text position.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() => runApp(const TextFieldExampleApp());

class TextFieldExampleApp extends StatelessWidget {
  const TextFieldExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: TextFieldExample(),
    );
  }
}

class TextFieldExample extends StatefulWidget {
  const TextFieldExample({super.key});

  @override
  State<TextFieldExample> createState() => _TextFieldExampleState();
}

class _TextFieldExampleState extends State<TextFieldExample> {
  late TextEditingController _controller;

  @override
  void initState() {
    super.initState();
    _controller = TextEditingController();
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: TextField(
          controller: _controller,
          onSubmitted: (String value) => print(value),
        ),
      ),
    );
  }
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

Firefox, cursor remaining in place until arrow key let go:

[cursor_firefox_cursor_not_moving.webm](https://github.com/user-attachments/assets/0d0aca43-59d0-4b92-a4c1-cfadf1878399)

Firefox, holding down shift while keeping an arrow key pressed shows the selection growing:

[cursor_firefox_selections.webm](https://github.com/user-attachments/assets/f78803c3-ee75-4399-90e9-b517455ba9ea)

Chrome, works as expected:

[cursor_chrome.webm](https://github.com/user-attachments/assets/72c3c70f-1588-4ccf-83b7-0473a08eff11)

</details>



### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.24.5, on Ubuntu 24.04.1 LTS 6.8.0-48-generic, locale en_US.UTF-8)
    • Flutter version 3.24.5 on channel stable at /home/abc/code/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision dec2ee5c1f (5 days ago), 2024-11-13 11:13:06 -0800
    • Engine revision a18df97ca5
    • Dart version 3.5.4
    • DevTools version 2.37.3

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/abc/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /snap/android-studio/161/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 18.1.3 (1ubuntu1)
    • cmake version 3.28.3
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[✓] Android Studio (version 2024.1)
    • Android Studio at /snap/android-studio/161
    • Flutter plugin version 81.0.2
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)

[✓] VS Code (version 1.95.1)
    • VS Code at /snap/code/current/usr/share/code
    • Flutter extension version 3.100.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 24.04.1 LTS 6.8.0-48-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 131.0.6778.69

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
```

</details>