-
Notifications
You must be signed in to change notification settings - Fork 36
Read Step options from tour.getCurrentStep() #390
Comments
Was able to achieve the desired behaviour with |
@cyremur |
@rwwagner90 So what I'm missing is the So with only touching the typings and not the underlying code, I assume one could just add the fields into the typings and have them fully accessible like so:
I can make a PR for exposing the options. Also, what's your release cycle for Shepherd and the React wrapping? I saw the react version still builds against Shepherd 7.1.0. Is there any chance the new typing can make it into a release soonish or will I have to build against my own fork? :) |
@cyremur the options are not meant to be exposed. Options are for building the tour and steps and not necessarily properties that will live on the final thing. As for releases, we're pretty good about updating. No need for a fork. |
@rwwagner90 I assumed they were meant to be hidden by design. Hm... I think the most important info is really
would be beneficial for more complex tours that advance steps on complicated interaction with Step targets. Specifically, I am working on a complex web app and want to say something like "Step 1: Type 'Hello World' into this textfield". The tour should then advance when the user actually types 'Hello World', which is a bit to complicated for the Shepherd 8 |
@cyremur anything accessible in vanilla JS should also be exposed when using TS, so if you need some types to expose |
Just so you know, currently, the JavaScript library as used in the demo website exposes pretty much everything. That's why I got the idea of just exposing Another candidate to be discussed is Anyway, @rwwagner90 here's a PR to close the issue: shipshapecode/shepherd#1044 |
@cyremur essentially anything you can do in JS should be possible in TS. We're not intentionally hiding anything. I just think |
closed by shipshapecode/shepherd#1044 |
For context, I have a tour that I want to advance when the user interacts with a highlighted object in a certain manner.
My component structure looks somewhat like this:
Now when
advanceTourConditionally(tour)
is triggered, I want to check if I'm in tour step X when the click occurs and if the current step is X then show the next step withtour.next()
.I was trying to use
tour.getCurrentStep()
but the react typing doesn't give me any access toStep.id
orStep.options.id
, even though it's there when I logtour.getCurrentStep()
. I can only accessStep.id
and log it to console if I force@ts-ignore
.Is it an intentional framework choice to hide
Step
properties? The Shepherd js main documentation doesn't give agetOptions()
function or similar either. What is the intended use oftour.getCurrentStep()
?The text was updated successfully, but these errors were encountered: