Repository: flutter
Issue: [webview_flutter] Google keyboard is losing focus when editing a label with `contenteditable=false`
Labels: a: text input,platform-android,p: webview,package,f: focus,has reproducible steps,P3,team-android,triaged-android,found in release: 3.27,found in release: 3.28

### Steps to reproduce

**Title**: Focus lost when cursor enters a label tag inside a contenteditable div using Google Keyboard in Flutter WebView

**Description:** I am rendering the following HTML content inside a WebView in my Flutter project using the webview_flutter package. The issue occurs specifically when using the Google Keyboard (Gboard) on Android devices.

**Problem:**
When the Google Keyboard cursor reaches the label tag inside the contenteditable div, the focus is immediately lost. This issue only happens with the Google Keyboard, other keyboards work as expected.

**Steps to Reproduce:**
1] Use a Flutter app with webview_flutter to render the below HTML.
2] Open the app on an Android device using the Google Keyboard (Gboard).
3] Start typing within the contenteditable div.
4] Move the cursor towards the <label> tag.
5] Observe that the focus is lost.


### Expected results

The focus should remain inside the contenteditable div even when the cursor moves over the label tag.

### Actual results

The focus is lost when the cursor interacts with the label element.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';

import 'package:webview_flutter/webview_flutter.dart';

class WebViewWidgetExample extends StatefulWidget {
  const WebViewWidgetExample({super.key});
  @override
  State<WebViewWidgetExample> createState() => WebViewWidgetExampleState();
}

class WebViewWidgetExampleState extends State<WebViewWidgetExample> {
  final WebViewController _controller = WebViewController();
  final Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers = {
    Factory(() => EagerGestureRecognizer())
  };
  @override
  void initState() {
    super.initState();
    grossDescriptionHtmlViewAndroid();
  }

  @override
  dispose() {
    super.dispose();
  }

  Future<void> grossDescriptionHtmlViewAndroid() async {
    _controller
      ..setJavaScriptMode(JavaScriptMode.unrestricted)
      ..setNavigationDelegate(
        NavigationDelegate(
          onPageFinished: (initialUrl) {},
          onPageStarted: (url) {},
          onWebResourceError: (error) {},
        ),
      )
      ..enableZoom(false)
      ..addJavaScriptChannel(
        "onChange",
        onMessageReceived: (content) {},
      )
      ..loadHtmlString(
        '''
            <!DOCTYPE html>
              <html lang="en">
                <head>
                    <meta charset="UTF-8">
                    <meta name="viewport" content="width=device-width, initial-scale=1.0">
                </head>
                <style>    

                  .grossDescription {
                    height: 300px;
                    font-size: 16px;
                    line-height: 1.6;
                    overflow-y: scroll;
                    overflow-x: hidden;
                    scrollbar-width: thin;
                    scrollbar-color: #8fbce1 #ffff;
                    outline: none;        
                    cursor: text !important;
                  }           

                  .grossDescription::-webkit-scrollbar {
                      width: 6px; /* Width of the scrollbar */
                      height: 6px; /* Height of the horizontal scrollbar */
                  }

                  .grossDescription::-webkit-scrollbar-track {
                      background: #bfd5e7; /* Background of the scroll track */
                  }

                  .grossDescription::-webkit-scrollbar-thumb {
                      background: #8fbce1; /* Color of the scrollbar thumb */
                      border-radius: 10px; /* Rounded corners of the scrollbar thumb */
                  }
               
                </style>
                <body>
                  <div id="editable-div" class="grossDescription" contenteditable="true" inputmode="text" oninput="notifyOnChange(this.innerHTML);notifyOnChange(this.innerText)">
                      Hello, this is editable 
                      <label contenteditable="false">This is non-editable</label> 
                      This is editable
                  </div>

                  <script>     
                   
                  </script>
                </body>
              </html>
        ''',
      );
  }

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        appBar: AppBar(
          backgroundColor: Colors.blue,
          title: const Text("Web view Example"),
        ),
        body: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Card(
            margin: EdgeInsets.zero,
            elevation: 4,
            shape: const RoundedRectangleBorder(
              side: BorderSide(
                color: Colors.grey,
              ),
            ),
            child: WebViewWidget(
              controller: _controller,
              gestureRecognizers: gestureRecognizers,
            ),
          ),
        ),
      ),
    );
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>

[√] Flutter (Channel stable, 3.19.0, on Microsoft Windows [Version 10.0.19045.3930], locale en-IN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.6.1)
[√] Android Studio (version 2024.1)
[√] VS Code (version 1.96.2)
[√] Connected device (4 available)
[√] Network resources

• No issues found!

</summary>

```console
[Paste your output here]
```

</details>