Jump to content
Search Community

Draggable on mobile

ClareBee test
Moderator Tag

Recommended Posts

Hi, New to GSAP & absolutely loving it so far! Ran into an issue though with Draggable on mobile. It works great on desktop/ipad, but when I try and drag a div horizontally along an svg line on my (old & janky) Motorola, it brings up the context menu (copy/select etc.). I've tried putting in the allowContextMenu explicitly, as below, but it still doesn't seem to latch onto the target (a div). Has anyone encountered this issue before? 

Any advice/help would be amazing! Sorry I haven't created a codepen - the scenario involves 2 massive svgs and loads of timeline code as well :) Happy to send a GitHub link privately if that would help? Thanks!

Draggable.create('#dragNavigator', {
  type: 'x',
  bounds: document.getElementById('container')
  allowContextMenu: false,
  cursor: 'grab',
  onDragStart: function() {
// some code
}})
Link to comment
Share on other sites

Hey @ClareBee! Welcome to the forums.

 

Are you using the latest version of Draggable? 3.2.6? 

 

And yeah, it'd be helpful to see the problem in context but it's really tough if you just send your entire project. It's always best to create a reduced test case with only the absolutely essential code to reproduce the problem. I'm not just recommending that for our benefit - it's just a good habit on your end too because that practice might expose the issue before you even need to ask us about it.

 

I'm not sure we can support your "old janky Motorola" to be honest. You may need to hunt for a way to disable the context menu for your particular browser. I wonder if it's just so old that it can't be worked around because the browser is so ancient (?) 

  • Like 2
Link to comment
Share on other sites

Thanks for responding so quickly - really awesome to have this forum to turn to! :) I think you might be right about the Motorola...! I bumped my versions up to the latest yesterday. I'll have a go at creating a codepen & in the meantime increasing up the size of the target on mobile to see if that's the issue. 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...