Skip to content

Expose moveNext, movePrevious in DriverHook #537

@BenClaveau

Description

@BenClaveau

If I want to use an async tour, I cannot call moveNext without having an external reference to the driver instance.

const driverObj = driver({
  showProgress: true,
  steps: [
    {
      popover: {
        title: 'First Step',
        description: 'This is the first step. Next element will be loaded dynamically.'
        onNextClick: () => {
          driverObj.moveNext();
        },
      },
    },
    { popover: { title: 'Last Step', description: 'This is the last step.' } }
  ]
});

Should be replace by this

const myDriverObj = driver({
  showProgress: true,
  steps: [
    {
      popover: {
        title: 'First Step',
        description: 'This is the first step. Next element will be loaded dynamically.'
        onNextClick: (driverObj, element, steps, opts) => {
          driverObj.moveNext();
        },
      },
    },
    { popover: { title: 'Last Step', description: 'This is the last step.' } }
  ]
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions