Jump to content
GreenSock

Ilima

dragClickables: true doesn't work

Moderator Tag

Recommended Posts

I'm trying to use Draggable with React and I don't seem to make it work. Currently I have this code and the version of react:

 

 

"dependencies": {
	"gsap": "^3.5.1",
    "react": "^16.8.1",
    "react-dom": "^16.8.1",
    "react-gsap": "^2.2.1",
}

 

Update:

Here is the link to code: https://codesandbox.io/s/gallant-morning-2ggfm

 

 

 

Link to comment
Share on other sites

Please make a demo on codesandbox.

https://codesandbox.io/

 

This is not needed. 

import { gsap, TimelineLite, TimelineMax, TweenMax, CSSPlugin } from "gsap";

 

https://greensock.com/docs/v3/Installation?checked=core,draggable#esModules

import { gsap } from "gsap";
import { Draggable } from "gsap/Draggable";

 

This is incorrect. this.dial is null.

this.dialPos = TweenMax.set(this.dial, {
  x: "+=0",
});

 

Should be gsap.set(), but only after mounted.

 

  • Like 2
Link to comment
Share on other sites

34 minutes ago, OSUblake said:

Please make a demo on codesandbox.

https://codesandbox.io/

 

This is not needed. 


import { gsap, TimelineLite, TimelineMax, TweenMax, CSSPlugin } from "gsap";

 

https://greensock.com/docs/v3/Installation?checked=core,draggable#esModules


import { gsap } from "gsap";
import { Draggable } from "gsap/Draggable";

 

This is incorrect. this.dial is null.


this.dialPos = TweenMax.set(this.dial, {
  x: "+=0",
});

 

Should be gsap.set(), but only after mounted.

 

Sorry about the mess. Updated it and here is the link https://codesandbox.io/s/bold-ishizaka-6st9k?file=/src/drag.jsx

Link to comment
Share on other sites

2 minutes ago, OSUblake said:

 

It doesn't seem to have any gsap code in it.

 

I removed it from Sandbox, since I'm just trying to get help with Draggable only

Link to comment
Share on other sites

We still need a demo to see the problem.

 

 

 

 

Link to comment
Share on other sites

15 minutes ago, OSUblake said:

We still need a demo to see the problem.

 

Hmm I think I just didn't save it... I'm new to Sandbox, can you see now? 

 

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.
×