Skip to content

Files

Latest commit

 

History

History
31 lines (27 loc) · 869 Bytes

auto-start.md

File metadata and controls

31 lines (27 loc) · 869 Bytes
title
AutoStart (manualStart: false)

The pre-bundled package includes the auto-start plugin which will start interactions when the pointer goes down and then moves on enabled target elements. You can disable this for an action by setting the manualStart option to true.

interact(target)
  .draggable({
    manualStart: true,
  })
  .on('doubletap', function (event) {
    var interaction = event.interaction

    if (!interaction.interacting()) {
      interaction.start(
        { name: 'drag' },
        event.interactable,
        event.currentTarget,
      )
    }
  })

With manualStart: true, you will need to start the action from a pointer event listener by calling event.interaction.start(actionInfo). Because the library no longer decides when to start actions, the cursor will not be set automatically.