phil21 Posted February 2 Share Posted February 2 Hello , i have this code made with react and Draggable , dont know why the left and right handler dont correctly set the width of the container , did i make a mistake , thanks in advance : https://codesandbox.io/s/confident-hermann-i8753p?file=/src/App.js See the Pen App.js by s (@s) on CodePen Link to comment Share on other sites More sharing options...
Rodrigo Posted February 2 Share Posted February 2 Hi @phil21 and welcome to the GreenSock forums! Thanks for the simple example, that made it super easy! 🥳 The main issue in this cases is to get the start position and width of the element and since the side handles are inside the containers keeping them in place is super easy. I made this example in codepen since I didn't had time to go through the whole React setup, but porting it to React shouldn't be too complicated. Also this considers the left handle but setting up the right one should follow a similar logic: See the Pen YzjdjWp by GreenSock (@GreenSock) on CodePen Sorry I wasn't able to come up with a full solution, but hopefully this is enough to get you on the right handle-track . Let us know if you have more questions. Happy Tweening! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now