Skip to content

The (plotly_click) output is not triggered when using mobile device #143

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

Closed
dmitriy-viniukov opened this issue Jan 12, 2021 · 7 comments
Closed

Comments

@dmitriy-viniukov
Copy link

I am building hybrid app using angular with capacitor. On iphone, when I try to click on data point, the (plotly_click) output is not fired. I tried deprecated (click) and it works.

@andrefarzat Could you please take a look?

@andrefarzat
Copy link
Collaborator

andrefarzat commented Jan 12, 2021

Hello @dmitriy-viniukov. I never tried angular-plotly.js with capacitor, but I believe this might be an issue with plotly click event not being triggered by the click/tap?

My first doubt is: are you trying the click event on the mobile (thus, the ontoutchstart event) or using on the browser (thus, the onclick event)?

@dmitriy-viniukov
Copy link
Author

@andrefarzat Thanks for fast response!

So I am trying browser event:

<plotly-plot (click)="onClick()" (plotly_click)="onPlotlyClick()"> </plotly-plot>

onClick() {
  console.log('click');
}

onPlotlyClick() {
  console.log('plotly click');
}

In console I see 'click' twice when tapping on data point on mobile.
I have just noticed that the issue is not only with capacitor. If I try to do the same with my application on mobile browser, (plotly_click) doesn't work as well. So the issue might be just with mobile interactions.

Thanks in advance

@dmitriy-viniukov
Copy link
Author

@andrefarzat small update: seems like the issue relates to Safari browser. (plotly_click) does not work there. Chrome is fine

@andrefarzat
Copy link
Collaborator

@dmitriy-viniukov this confirm what I was supposing: The plotly.js itself isn't triggering the plotly_click, thus angular-plotly.js can't trigger the (plotly_click) also. It's curious for why this doesn't work in safari ( blink and webkit aren't that different ). Have you tried in the other browsers' engine (e.g.: firefox, IE ?)

@dmitriy-viniukov
Copy link
Author

@andrefarzat I have just tried in firefox and it does not work as well

@dmitriy-viniukov
Copy link
Author

@andrefarzat So should I create a topic in plotly.js repo with that issue or it is something that you can fix from your side?

@andrefarzat
Copy link
Collaborator

@dmitriy-viniukov it's good to open an issue there. I made a search on the previous issues and looks like mobile isn't 100% supported: plotly/plotly.js#1858

I dunno if tap events are converted to click events, for example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants