-
-
Notifications
You must be signed in to change notification settings - Fork 353
Open
Description
Description
Hi! I noticed that when I disable actions on a step with disableActions: true, this setting persists on subsequent steps. Actions can only be reenabled by explicitly setting disableActions to false on the next step. Is this an intended behavior?
Steps to reproduce
You can observe this behavior in this code sandbox: https://codesandbox.io/p/sandbox/thirsty-cache-zz6yzk
Expected behavior
disableActions: true should not be preserved between steps. The next step without this setting should be interactive.
Potential root cause
In the Tour implementation, the state variable that controls whether actions are disabled only changes when step.disableActions is defined. This explains why actions can only be reenabled by explicitly setting disableActions to false.
// packages/tour/Tour.tsx, line 111
useEffect(() => {
if (step?.action && typeof step?.action === 'function') {
step?.action(target)
}
if (step?.disableActions !== undefined) { // ⬅️ here
setDisabledActions(step?.disableActions)
}
return () => {
if (step?.actionAfter && typeof step?.actionAfter === 'function') {
step?.actionAfter(target)
}
}
}, [step])Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels