Closed agonza1 closed 6 years ago
Ran into the same issue as I tried swapping in draggabilly to replace jquery ui draggable. It's containment, not container (which is what jquery ui draggable uses). Hope that helps you too!
containment: 'html'
is the best approach.
Is there a generic suggested approach for containing a draggable element inside the screen in a website?
I saw an approach using ~
container: 'html'
~containment: 'html'
in the initialization of the draggable object but it still allows the user to drag the object outside the screen. Also, it depends on the html element (which could be smaller than the screen?). Is there a more generic approach without additional elements such as the container?