-
-
Notifications
You must be signed in to change notification settings - Fork 344
-
-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The event onClickMask should receive the current steps #425
Comments
In fact, the initial |
Hi @yanickrochon, thanks for open the Issue. Could you please share a sandbox in order to try and understand better the issue. Basically I'm not sure I am getting the part
since Thanks in advance, |
Hi @elrumordelaluz , I thought it was clear, but here's a minimalist sandbox. In short, I will have multiple tours in the app, all using the same Currently, there is no easy way to know what Also note that the prop reactour/packages/tour/src/Tour.tsx Line 15 in c023981
so having it being a required prop is silly, it isn't required since it does not break the component when it isn't provided, and also since it can be set from the hook or the HOC. In other words, |
Absolutely clear @yanickrochon, thanks for the sandbox! |
Everything should be available on |
Remember to update the docs, but everything's good! Thanks! |
@elrumordelaluz (I just found out about Reactour, this week, but I do plan on forking this repo and actually contribute. I've had a 15 hours days all week, so it's pretty crazy right now. I should have time to make PRs next time.) |
lol, I added the
Each PR is pretty welcome, thanks! |
Considering that declaring a
TourProvider
with specific steps may be modified externally through a hook, for example, theonClickMask
handler receive bothcurrentStep
andsetCurrentStep
, but cannot garantee that thesteps
within that context is the same as when the even is fired.For example, given my current situation, the tour can only be closed with the mask at the very last step (and will optionally be allowed in other specific cases later on), so I declare my provider like such :
In other word, the initial
steps
is an empty array, and is replaced by various components using the sameTourProvider
. Unfortunately, once a component callssetSteps
somewhere else in the code, the provider is not notified, and I'm not interested to keep a state of this value anyway. Thus, whenonClickMask
is called, there is an inconsistency betweencurrentStep
anddefaultSteps
.Therefore, the following line
reactour/packages/tour/src/Tour.tsx
Line 72 in c023981
Should be changed to
Point to note, the initial
steps
should either be optional, or there should be a new prop, calledonStepsChanged
(for example), added to the available props, which would update the provider'ssteps
once it is changed somewhere else.The text was updated successfully, but these errors were encountered: