Skip to content

[iOS] Permission dialog when pasting text from universal clipboard may be closed before user has had time to allow pasting #121446

Open
@HaloWang

Description

@HaloWang

Steps to Reproduce

  1. flutter create handoff_clipboard
  2. prepare a macbook and any iOS deivce
  3. make sure Apple's 'Handoff' feature is enabled on the devices above.
  4. add a TextField() at somewhere of the lib/main.dart
  5. run flutter on the ios device
  6. cmd+c some text on the screen of macOS
  7. tap TextField widget on the screen of iOS
  8. tap "Paste"
  9. There flash an alert and then disappear, leave a Error in console (Xcode/vscode): [Pasteboard] ...requesting item failed with error: Error Domain=PBErrorDomain Code=13 "Operation not authorized." UserInfo={NSLocalizedDescription=Operation not authorized.}
  10. tap paste again, the alert will stay on the screen, looks good.

some codes in starter project, if useful

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          // 🚧 add this line
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
            // 🚧 add this line
            TextField(),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }

flutter doctor

➜  ~ flutter doctor          
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.5, on macOS 13.2.1 22D68 darwin-arm64, locale en-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.75.1)
[✓] Proxy Configuration
[✓] Connected device (3 available)
[✓] HTTP Host Availability

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms bettera: text inputEntering text in a text field or keyboard related problemsfound in release: 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions