In some cases, its necessary to change the Joyride props only for particular steps. For example, in some of my steps, I want to show an overlay, but not in other steps. Rather than changing the <Joyride showOverlay /> prop, it would be great to specify in the steps array itself:
const steps = [{
title: 'step1',
target: '.myclass',
showOverlay: false,
}]
In this case, the value specified in the step would have priority over any props provided to the Joyride. Other props which I think would be good to be able to override:
localeholePaddingscrollOffsetscrollToStepshowBackButtonshowSkipButtondisableOverlayAnd maybe a few others. What do you think about allowing properties like that to be specified on steps to override the global props of the Joyride? I can immediately submit PRs for at least holePadding and scrollToStep.
LGTM.
However I think it will be better to add support to all props at once..
Looking at the code today it will need to change a lot of code for all options to work. Maybe it is better to add just the big ones for now?
And pass these options inside a props property instead of the root step? I think it will be easier to document.
Thoughts?
Hm, personally it doesn't bother me to have a flat structure, since props is short for properties, and a step is just an object with properties. :) I like the idea of either specifying them on the joyride or directly on the step (kind of similar to "Setting tour options" in http://linkedin.github.io/hopscotch/).
I haven't looked at what it would take to override all of them. The ones I mentioned are basically one-line changes. But, it would be nice to (eventually?) generalize the logic so that whenever a prop is needed, we first check the current step, and then the Joyride props. Having that check in one method instead of spread around would be nice and clean.
As for documenting the options, I think that's just a matter of organizing the README and explaining it. I can take a shot at it, and if you think it's unclear we can put them in a props if you prefer, how about that?
Let's go flat. I need to rewrite the README anyway.
:)
Speaking of step properties, I have some questions for you, do you use gitter?
Yeah, sometimes.. But it's almost 4AM here, I'll crash now. 馃槾
You can add me in Gtalk too, I'm always online there. [email protected]
Or plain email too..
All tour props can be overridden in V2
npm i react-joyride@next