Repository: flutter
Issue: TextField doesn't receive input in focused state above PlatformView in Firefox
Labels: a: text input,a: platform-views,p: maps,platform-web,package,has reproducible steps,browser: firefox,P2,team-web,triaged-web,fyi-text-input,found in release: 3.24,found in release: 3.27

### Steps to reproduce

1. Run flutter app for web: `flutter run -d web-server --web-renderer canvaskit`
2. Open the URL in Firebox: `lib/main.dart is being served at http://localhost:XXXXX`
3. Open dialog with a tab on the `FloatingActionButton`
4. Click into the textfield and try to add input


Firefox Version: 132.0 (aarch64)

### Expected results

The textfield receives the input from the keyboard.

### Actual results

The input doesn't receive the input, even the textfield received the focus.

A super weird behavior is that the textfield receives the input when switching the tab: see video

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:web/web.dart' as web;

void main() {
  runApp(App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Builder(
          builder: (context) {
            return Stack(
              children: [
                Positioned.fill(child: NativeMap()),
                Center(
                  child: FloatingActionButton(
                    child: Icon(Icons.open_in_browser),
                    onPressed: () {
                      showDialog<void>(
                        context: context,
                        barrierDismissible: false,
                        builder: (context) => Dialog(
                          child: SizedBox(
                            height: 300,
                            width: 200,
                            child: Padding(
                              padding: const EdgeInsets.all(20.0),
                              child: Column(
                                children: [
                                  IconButton(
                                    onPressed: () {
                                      Navigator.of(context).pop();
                                    },
                                    icon: Icon(Icons.close),
                                  ),
                                  TextField(
                                    decoration: InputDecoration(
                                      contentPadding: EdgeInsets.all(20),
                                    ),
                                  ),
                                ],
                              ),
                            ),
                          ),
                        ),
                      );
                    },
                  ),
                ),
              ],
            );
          },
        ),
      ),
    );
  }
}

class NativeMap extends StatelessWidget {
  const NativeMap({super.key});

  @override
  Widget build(BuildContext context) {
// this could also be GoogleMaps, Maplibre, etc.
    return HtmlElementView.fromTagName(
      tagName: 'div',
      isVisible: true,
      onElementCreated: _onElementCreated,
    );
  }

  void _onElementCreated(Object element) {
    (element as web.HTMLElement)
      ..style.width = '100%'
      ..style.height = '100%'
      ..style.backgroundColor = '#FF0000';
  }
}


```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>


https://github.com/user-attachments/assets/0732ccb3-157b-41f1-8e19-1d4378824574



</details>


### Logs

<details open><summary>Logs</summary>

```console
...
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.24.3, on macOS 14.6.1 23G93 darwin-arm64 (Rosetta), locale de-DE)
    • Flutter version 3.24.3 on channel stable at /Users/stefanschaller/fvm/versions/3.24.3
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (vor 8 Wochen), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/stefanschaller/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Users/stefanschaller/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16B40
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2)
    • Android Studio at /Users/stefanschaller/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 21.0.3+-79915917-b509.11)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.2.4)
    • IntelliJ at /Users/stefanschaller/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 82.0.3
    • Dart plugin version 242.22855.32

[✓] Connected device (4 available)
    • Stefan‘s iPhone (mobile)        • 00008120-000858943610A01E • ios            • iOS 18.0 22A3354
    • macOS (desktop)                 • macos                     • darwin-arm64   • macOS 14.6.1 23G93 darwin-arm64 (Rosetta)
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin         • macOS 14.6.1 23G93 darwin-arm64 (Rosetta)
    • Chrome (web)                    • chrome                    • web-javascript • Google Chrome 130.0.6723.92

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>