Closed edwinbbu closed 5 years ago
In reference to issue #447 , the answer provided for closing the issue is: Yes, use the callback prop in V2. https://github.com/gilbarbara/react-joyride/blob/master/docs/callback.md
But the issue is that I have to manually trigger the joyride from the onclick event
<a className="btn btn-ss-primary" id="onboarding1" onClick={
(e) => {
this.props.incrementStepCount({
stepIndex: this.props.onboardingTour.stepIndex + 1,
run: true,
});
}}>
I have given id="onboarding1" as target in steps array. The joyride callback is triggered automatically on button click
It's impossible to know what is happening without seeing some code, so I need a reproduction example, preferably on codesandbox.
BTW, do you really need to have a controlled tour with stepIndex
?
A standard tour usually doesn't need it...
I have created a sample code in codesandbox . I am expecting the button click the automatically trigger any joyride event @gilbarbara
The custom button below the title?
Since it is outside the Joyride UI it is your job to handle the click. This library can't access elements outside its domain. When you set a target, it is used as the origin for Joyride's positioning and highlighting but the content inside it is not used.
🐛 Bug Report
button on click is not triggering any joyride action/event in controlled mode.
To Reproduce
Create joyride navigation with options:
spotlightClicks: true, stepIndex: 2
Expected behavior
Button click to trigger
action='next'
in the joyride callback event