Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose moveNext, movePrevious in DriverHook #537

Open
BenoitClaveau opened this issue Dec 30, 2024 · 0 comments
Open

Expose moveNext, movePrevious in DriverHook #537

BenoitClaveau opened this issue Dec 30, 2024 · 0 comments

Comments

@BenoitClaveau
Copy link

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.' } }
  ]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant