Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: popover with context-menu triggeraction does not work on iOS #25471

Open
4 of 7 tasks
matus-m opened this issue Jun 15, 2022 · 2 comments
Open
4 of 7 tasks

bug: popover with context-menu triggeraction does not work on iOS #25471

matus-m opened this issue Jun 15, 2022 · 2 comments
Labels
bug: external Bugs in non-Ionic software that impact Ionic apps (I.e. WebKit, Angular, Android etc) type: bug a confirmed bug report

Comments

@matus-m
Copy link

matus-m commented Jun 15, 2022

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

Popover with context-menu trigger action does not work on iOS. click works fine.

Expected Behavior

Popover with triggerAction="context-menu" should appear on iOS if I long press the button(trigger element)

Steps to Reproduce

Create a new ionic angular app with ionic start myapp add popover to some component:

<!-- Use a trigger -->
<ion-button id="trigger-button">Click Works</ion-button>
<ion-popover trigger="trigger-button">
  <ng-template>
    <ion-content>Popover Content</ion-content>
  </ng-template>
</ion-popover>

<ion-button id="trigger-button2">Context menu does not work</ion-button>
<ion-popover trigger="trigger-button2" triggerAction="context-menu">
  <ng-template>
    <ion-content>Popover Content</ion-content>
  </ng-template>
</ion-popover>

Run on iOS device. Click based trigger presents the popover, the one with context-menu does not.

Code Reproduction URL

https://github.com/yntelectual/ionic-popover-bug

Ionic Info

Ionic:

Ionic CLI : 6.18.2 (/Users/matus/.nvm/versions/node/v16.13.2/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 6.1.9
@angular-devkit/build-angular : 14.0.2
@angular-devkit/schematics : 14.0.2
@angular/cli : 14.0.2
@ionic/angular-toolkit : 6.1.0

Capacitor:

Capacitor CLI : 3.5.1
@capacitor/android : not installed
@capacitor/core : 3.5.1
@capacitor/ios : 3.5.1

Utility:

cordova-res : not installed globally
native-run : 1.6.0

System:

NodeJS : v16.13.2 (/Users/matus/.nvm/versions/node/v16.13.2/bin/node)
npm : 8.4.0
OS : macOS Monterey

Additional Information

Tested on iOS 15.5

@ionitron-bot ionitron-bot bot added the triage label Jun 15, 2022
@liamdebeasi liamdebeasi self-assigned this Jun 21, 2022
@liamdebeasi
Copy link
Contributor

Thanks for the issue. The popover component listens for the contextmenu event in order to show the popover when triggerAction="context-menu". It looks like iOS has a known bug where contextmenu is not fired (but is sometimes fired on iPadOS): https://bugs.webkit.org/show_bug.cgi?id=213953

We may be able to work around this by listening for a touchstart event and then opening the popover in a setTimeout, though this could cause issues if the iOS contextmenu bug is ever fixed in the future.

@liamdebeasi liamdebeasi added type: bug a confirmed bug report bug: external Bugs in non-Ionic software that impact Ionic apps (I.e. WebKit, Angular, Android etc) labels Jun 21, 2022
@liamdebeasi liamdebeasi removed their assignment Jun 21, 2022
@ionitron-bot ionitron-bot bot removed the triage label Jun 21, 2022
@lil5
Copy link

lil5 commented Jul 28, 2023

After finding this issue, I've moved to using use-long-press

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: external Bugs in non-Ionic software that impact Ionic apps (I.e. WebKit, Angular, Android etc) type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

3 participants