d3-context-menu icon indicating copy to clipboard operation
d3-context-menu copied to clipboard

Does it support touch devices?

Open vijaythummar opened this issue 6 years ago • 1 comments

Can we integrate context menu for touch devices?

vijaythummar avatar May 21 '18 14:05 vijaythummar

I haven't tested it in touch devices, but it should work on them. Just attach the appearance of the menu to the event you want (see the examples). For example:

.on('contextmenu', d3.contextMenu(menu)); // attach menu to element

That attaches the menu to the right-click event ("contextmenu"). You could change "contextmenu" to "click" and it should cause the menu to appear when the object is clicked/touched.

patorjk avatar May 21 '18 14:05 patorjk