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

Shouldn't respond to the scroll event on mobile device #23

Open
togepige opened this issue Mar 22, 2018 · 7 comments
Open

Shouldn't respond to the scroll event on mobile device #23

togepige opened this issue Mar 22, 2018 · 7 comments

Comments

@togepige
Copy link

Hey I just found a little problem on mobile device that the hint will be triggered when I hold my finger on the target and then scroll the screen even I set the events to "click".

I think it is not the expected behavior as holding and scrolling should not trigger click on mobile device. I guess the reason is because in the last line of toggleEvent function you register a handler for "touchend" even for click?

ToggleEvent function

@slmgc
Copy link
Owner

slmgc commented Mar 22, 2018

This is related to another bug: #12
Basically, there was an issue with click events in iOS, that's why a touch event handler was introduced. Removing this handler is not an option as it will break the tooltip for iPhone users, but I am open to suggestions.

@togepige
Copy link
Author

Hey Vladimir,

Thanks for a quick reply! So what about just remove that touchend handler for click? Sounds like we the touchend should only apply to hover for hiding the tooltip I guess? And for click I don't think touchend event is necessary as all we need is a click event?

Some thing like this:
Before:
;(click || hover || hasEvents) && document[action]('touchend', this.toggleHint)
To:
;(hover || hasEvents) && document[action]('touchend', this.toggleHint)

@slmgc
Copy link
Owner

slmgc commented Mar 22, 2018

Hey Junkai! Thanks for this suggestion, I'll check it out and see if it resolves the issue.

@slmgc
Copy link
Owner

slmgc commented Mar 27, 2018

Ok, I've checked your proposal and it seems it's not an option to remove a touch event handler for click events as it breaks tooltips in iOS.

@slmgc
Copy link
Owner

slmgc commented Mar 29, 2018

@cyfloel0516 can you provide a repro with your case so I can try to figure out a way to solve it?

@togepige
Copy link
Author

Hey @slmgc! I don't have a repo to show you now. But actually you can simply use your Demo Page to reproduce the issue.

Two ways to reproduce:

  1. With chrome debugger: debug the website with mobile device mode. Then hold the mouse on one of those two green buttons("Click Me") and move the mouse(simulate scrolling). You can see it the hint will be opened or closed.

  2. Open the Demo Page with iPhone and do the same thing as way 1. And you can see it will open(or close) the hint as well.

@slmgc
Copy link
Owner

slmgc commented Jun 14, 2018

Hey, I am currently working on the new API which will allow more freedom in trigger-events customization. This should resolve your use-case.

@slmgc slmgc added the v4 label Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants