Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Disable Contextmenu on mobile #98

Closed
tedicela opened this issue Apr 5, 2017 · 1 comment
Closed

Disable Contextmenu on mobile #98

tedicela opened this issue Apr 5, 2017 · 1 comment

Comments

@tedicela
Copy link

tedicela commented Apr 5, 2017

How to disable contextmenu on mobile and let the setted events to trigger normally (onclick/ondbclick) setted on the ContextMenuTrigger tag?

The html tag that trigger the menu has onclick and ondbclick events. These events aren't fired on mobile devices but on PC they get fired. The context menu is fired on right-click(Desktop) and on long-press(mobile). Is possible to disable completely like there is no contextmenu on mobile?

danbovey added a commit to danbovey/react-contextmenu that referenced this issue Apr 22, 2017
As far as I'm aware, this isn't needed. Fixes vkbansal#98.
@danbovey
Copy link
Contributor

You don't need to get rid of your context menus on mobile, it's just this line: https://github.com/vkbansal/react-contextmenu/blob/master/src/ContextMenuTrigger.js#L61 that's preventing anything being regularly clicked on mobile.

Opened a pull request to remove it: #102

I don't know why it's there, holding for right click and opening the menu doesn't cause a link to be clicked, and so without it onclick events work for content inside the ContextMenuTrigger!

@danbovey danbovey mentioned this issue Apr 23, 2017
2 tasks
vkbansal pushed a commit that referenced this issue Apr 28, 2017
* Remove e.preventDefault from handleTouchEnd

As far as I'm aware, this isn't needed. Fixes #98.

* Touch handled for mobile, Mobile view on examples

* Remove static from touchHandled

* Move inside lambda function

* Expand setTimeout

* Update ContextMenuTrigger.js

* Set touchHandled = false

* Remove trailing spaces
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants