Tkko / Flutter_Pinput

Flutter package to create Pin code input text field with every pixel customization possibility 🎨 with beautiful animations, iOS autofill, Android autofill
https://pub.dev/packages/pinput
MIT License
775 stars 179 forks source link

Paste button isn't shown on mobile web #188

Open agordeev opened 5 months ago

agordeev commented 5 months ago

Tested on example app.

On iOS, the long press shows the paste button.

On web iOS, the long press does nothing.

iOS app (works as expected):

https://github.com/Tkko/Flutter_Pinput/assets/2883524/e266e8c3-2e32-400a-82b5-1c98372baf5e

iOS web app (doesn't work as expected):

https://github.com/Tkko/Flutter_Pinput/assets/2883524/9a12c690-b6fc-4745-bd4e-cd2c7a9d708e

Tkko commented 3 months ago

Hi @agordeev, Sorry for the late reply, on the web you have to disable the default context menu

  @override
  void initState() {
    super.initState();
    // On web, disable the browser's context menu since this example uses a custom
    // Flutter-rendered context menu.
    if (kIsWeb) {
      BrowserContextMenu.disableContextMenu();
    }
  }

  @override
  void dispose() {
    if (kIsWeb) {
      BrowserContextMenu.enableContextMenu();
    }
  }