modifiers
Use modifiers to change the coordinates of drag, resize and gesture events.
The options
object passed to the action methods can have a modifiers
array
which will be applied to events of that action type.
const restrictToParent = interact.modifiers.restrict({
restriction: 'parent',
elementRect: { left: 0, right: 0, top: 1, bottom: 1 },
})
const snap100x100 = interact.modifiers.snap({
targets: [interact.snappers.grid({ x: 100, y: 100 })],
}),
interact(target).draggable({
modifiers: [restrictToParent, snap100x100],
})
Modifers in the array are applied sequentially and the order may affect the
result.