Constrain mirrors to their containers with Dragula
npm install dragula-constrain

Constrain mirrors to their containers with Dragula, similar to jQuery UI draggable's contain.
Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.
You can install the package via npm:
``bash`
$ npm install dragula-constrain
dragula-constrain supports at least all modern browsers, starting from IE10.
`es6
import dragula from 'dragula';
import constrain from 'dragula-constrain';
// Set up myContainer and options..?
const dragula = dragula(myContainer, options);
constrain(dragula);
`
That's it! The mirror shouldn't spill out of the container anymore while dragging.
This package assumes that the mirror has a fixed position, and the container is non-fixed. It currently only supports constraining mirrors to Dragula's first container (custom container support might get implemented in the future).
Please see CHANGELOG for more information what has changed recently.
` bash``
$ npm run test
Please see CONTRIBUTING for details.
If you discover any security related issues, please contact Sebastian De Deyne instead of using the issue tracker.
- Sebastian De Deyne
- All Contributors
The MIT License (MIT). Please see License File for more information.