React Joyride not triggering scroll

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dropbeardancommented, Jun 5, 2019

The demo works because it is triggering scrollToFirstStep

0reactions
dropbeardancommented, Jun 5, 2019

I will close this issue and log a genuine bug

Read more comments on GitHub >

github_iconTop Results From Across the Web

gilbarbara/react-joyride - disable scrolling not working. - GitHub
I'm trying to target 'body' with a splash intro on the tour but my body is bigger than the screen so the overlay...
Read more >
React Joyride scrolling - Stack Overflow
For elements that are hidden can I make joyride scroll to the element according to the relative panel and scroll it if its...
Read more >
Works with custom scrolling parents! - React Joyride Demo
Portals provide a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component. render()...
Read more >
gilbarbara/react-joyride - Gitter
we're trying to scroll to the side (the right, specifically) -- not up, and down. any ideas? Sara Inés Calderón.
Read more >
react-joyride - CodeSandbox
Forked Fromreact-joyride-V1; Environmentcreate-react-app ... Scroll. components. App.css. index.html. index.js. package.json. Dependencies. disable-scroll.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found