Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
greg_mich

Greg M

Recommended Posts

I am using draggable on a custom keyboard. The issue I run into is when you accidentally drag on the keys the keyboard drags and the key press is not fired. My question is, is there a way to only drag a component from the background? And not allow drag on inner elements?

Link to comment
Share on other sites

It sounds like you'd want to set dragClickables to false. From the docs.

  • dragClickables:  Boolean - By default, Draggable will work on pretty much any element, but sometimes you might want clicks on <a>, <input> <select>,<button>, and <textarea> elements (as well as any element that has a data-clickable="true"attribute) NOT to trigger dragging so that the browser's default behavior fires (like clicking on an input would give it focus and drop the cursor there to begin typing), so if you want Draggable to ignore those clicks and allow the default behavior instead, set dragClickables:false. (note: before GSAP 2.0.0, dragClickables was false by default)

 

https://greensock.com/docs/Utilities/Draggable

 

Hopefully that helps. Happy tweening.

Link to comment
Share on other sites

Do I apply this in my create function or on  the elements themselves? I am also using Vue.js by the way.

Link to comment
Share on other sites

Is there a way to apply that to specific divs? And not just buttons?

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