I'm pretty new to introjs-react
. I have gone through the documentation and know there are 2 props available onExit
and onComplete
. The previous is called when we skip a step (for example when clicking outside the step on the overlay) and the latter is called when done
is pressed. I want to call a method when the close button (the cross icon) on the step is pressed.
This is how my current step looks like
Here's how my code looks like
<Steps
enabled={activateDemo}
steps={steps.map((step) => ({ ...step, tooltipClass: classes.tooltipClass }))}
initialStep={0}
ref={(ref) => {
introJsRef.current = ref;
}}
options={{
exitOnOverlayClick: false,
scrollToElement: true,
scrollTo: 'tooltip',
disableInteraction: true,
showButtons: true,
}}
onBeforeChange={(nextStepIndex) => {
if (steps[nextStepIndex] && introJsRef.current)
introJsRef.current!.updateStepElement(nextStepIndex);
return true;
}}
onExit={onExit}
onComplete={onComplete}
onClose={onComplete} // <---- Does something of this sort exists??????
/>
);
This is the documention I'm going through. Any leads would be much appreciated.