React Joyride not triggering scroll
See original GitHub issueI am currently using React Joyride v2.0.5 and am using custom components:
A custom tooltip with tooltipProps passed to it.
A custom next button with primaryProps passed to it.
Each of my steps have disableBeacon: true as a property
When I go through the steps in the Tour, the page does not scroll despite the target not being on the page at all.
After investigating, it seems like the shouldScroll is always returning false: https://github.com/gilbarbara/react-joyride/blob/master/src/components/index.js#L273
This is due to the following events occurring in the mentioned order on my local system:
Sequence of events:
1: {
lifecycle: "init",
index: 3,
prevState: {
action: "update"
controlled: false
index: 2
lifecycle: "tooltip"
size: 7
status: "running"
},
}
2: {
lifecycle: "ready",
index: 3,
prevState: {
action: "next"
controlled: false
index: 3
lifecycle: "init"
size: 7
status: "running"
}
}
3: {
lifecycle: "tooltip",
index: 3,
prevState: {
action: "next"
controlled: false
index: 3
lifecycle: "ready"
size: 7
status: "running"
}
}
Based on the conditions in the link above (https://github.com/gilbarbara/react-joyride/blob/master/src/components/index.js#L273) it can never pass since the tooltip lifecycle event happens last so the index will never match. The beacon lifecycle event won’t happen because I disabled a beacon.
I noticed that the scrolling is currently working on the DEMO, I will check it out and see what the difference between them are.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Related StackOverflow Question
The demo works because it is triggering scrollToFirstStep
I will close this issue and log a genuine bug