Repository: flutter
Issue: Web FocusableActionDetector stops working after using Ctrl + F or Ctrl + P
Labels: framework,platform-web,has reproducible steps,P2,team-web,triaged-web,found in release: 3.22,found in release: 3.23

### Steps to reproduce

1. Start flutter app on web
2. Click shortcuts defined in code(works)
3. Click Ctrl + F or Ctrl + P
4. Close the Search bar or the print screen.
5. On the app try clicking on shortcuts again (not working)

It works normally when selecting "Find in Page" or "Print" through the three dots menu in chrome but not when using Ctrl+ F or Ctrl + P.

### Expected results

App should resume and work like it was before opening search or print

### Actual results

App stops responding to the defined shortcuts

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() => runApp(const MaterialApp(home: MyHomePage()));

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() => setState(() => _counter++);
  void _decrementCounter() => setState(() => _counter--);

  void keyboardActions(ShortcutIntent intent) async {
    if (intent.type == Events.plus) _incrementCounter();
    if (intent.type == Events.minus) _decrementCounter();
  }

  final shortcuts = {
    LogicalKeySet(LogicalKeyboardKey.keyA): const ShortcutIntent.plus(),
    LogicalKeySet(LogicalKeyboardKey.keyB): const ShortcutIntent.minus(),
  };

  @override
  Widget build(BuildContext context) {
    return FocusableActionDetector(
      shortcuts: shortcuts,
      actions: {
        ShortcutIntent: CallbackAction<ShortcutIntent>(
          onInvoke: keyboardActions,
        )
      },
      autofocus: true,
      child: Scaffold(
        body: Center(child: Text('$_counter')),
        floatingActionButton: FloatingActionButton(
          onPressed: _incrementCounter,
          child: const Icon(Icons.add),
        ),
      ),
    );
  }
}

enum Events {
  plus,
  minus;
}

class ShortcutIntent extends Intent {
  final Events type;
  const ShortcutIntent.plus() : type = Events.plus;
  const ShortcutIntent.minus() : type = Events.minus;
}

```

</details>


### Screenshots or Video

_No response_

### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel main, 3.23.0-13.0.pre.236, on KDE neon 6.0 6.5.0-35-generic, locale fr_FR.UTF-8)
    • Flutter version 3.23.0-13.0.pre.236 on channel main at /home/gaya/software/flutter_dev
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision be94ed8bdf (il y a 2 heures), 2024-06-14 11:55:20 -0400
    • Engine revision 8167dffd19
    • Dart version 3.5.0 (build 3.5.0-254.0.dev)
    • DevTools version 2.36.0

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/gaya/software/androidsdk/
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /home/gaya/software/androidsdk/
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+9-Ubuntu-122.04.1)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 14.0.0-1ubuntu1.1
    • cmake version 3.29.0
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] Connected device (3 available)
    • 220733SL (mobile) • 192.168.100.55:40439 • android-arm    • Android 12 (API 31)
    • Linux (desktop)   • linux                • linux-x64      • KDE neon 6.0 6.5.0-35-generic
    • Chrome (web)      • chrome               • web-javascript • Google Chrome 126.0.6478.61

[✓] Network resources
    • All expected network resources are available.

```

</details>