-
Notifications
You must be signed in to change notification settings - Fork 37
Tour renders at top left of page after component updates, creates new tour instance for component #713
Comments
Bump on this.... |
@dchersey sorry, haven't had time to chime in on this. It seems odd that on rerender it doesn't pickup the active tour, but perhaps something is different enough in memory that it's creating a new one. Would you be able to share a codesandbox or something to help replicate the issue for debugging? |
@dchersey I'm having a pretty tough time trying to replicate. I'm wondering if using the |
If you're using nextjs, part of the issue seems to be that the provider is mounted not on the layout file, but in a component/page. So it may get rendered twice, once on the server and once on the client. Moving the provider to the layout file helped me. So, something like:
|
This is with pages router yeah? |
It's the app router in this case iirc, but it's been a while since I last looked at this. |
Ahh I see, |
@AHarmlessPyro While I've got someone who uses this library in Next.js here (this is at least tangentially related since it involves positioning): have you ever had an issue where your tutorial popups are missing their left positioning until you scroll? Thanks 🙏 |
Hi, I am using react-shepherd 4.2.0, and have defined a single Shepherd context in App.jsx as the highest level component.
I have created a component that is rendered on one of my modal views, with steps for that view, to which I pass in step definitions in props.
The step in question looks like:
The problem I am having is that when a user hits one of the tabs on my modal, causing it to re-render, if the tour is active it now displays in the top left of the full page.
You can see that the little arrow is still visible on the left, so it does not seem to be the case that it can't resolve my selector.
(I tried using a function to return the selector but that did not change anything).
What is even more interesting is that if I click my GuideMe button again while it is in this state, a second tour opens in the proper place.
I am thinking this could be related to #587 but I also see that has been fixed by memoizing -- still when I add this code:
to my GuidMe component, I get this output:
as I click around between tabs with the tour open. Note different tour.id and that the last 3 are inactive even though the first one is still showing.
So somehow, I am getting more than one tour, and the first one is getting disconnected from the ui? If I click the button again, the new one renders in the right place but the orphaned one is still visible.
Any thoughts, most welcome!!!
The text was updated successfully, but these errors were encountered: