reactour
reactour copied to clipboard
[Question] Mask auto move in tour mode
Hey, Firstly thanks for your work it's amazing ! But I have a problem when I implemented the tour mode, by default the mask don't move when user scroll Is there a simple way to implement that using the current code of the lib or do I need to make something on my
If this does not exist atm, it can be nice if we had just a option to change to have this behavior
Awaiting your reply & Best Regards, Paul Millet
You can use the mutationObservables
property (add it to each step) to trigger the Mask to recompute its position.
// steps
const steps = [
{
selector: ".some-element",
mutationObservables: [`[data-tour-id="mask-position-recompute"]`]
}
]
// Some component that sits as a child of the TourProvider.
// Change 'id' whenever you want the mask for the step to recompute its position.
const [id, setId] = React.useState("")
return <span key={id} data-tour-id="mask-position-recompute" />
Thanks :)
Checking this now !