talamaska / onboarding_overlay

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hi Guys!, there is way to go the previous item?

rodrileonel opened this issue · comments

I haven't planned for this feature. You could restart the onboarding if the user have missed something or needs a reminder.
The implementation is done that way - If the user wants to display a slice of the list of the step he/she needs to set the stepIndexes, if it is set, then when navigating to the next step the previous is removed from the stack. If you display all the steps as defined in the steps List, then the items are not removed, I haven't made any logic to support navigating back.

I did have an end user that requested this feature. It's not a deal breaker, but it might be a nice to have in the stepBuilder if not to hard to implement.

It's hard to implement. The whole logic around the stepper is removing an item from the beginning of the list on next step. If I have removed the item from the list, I can't go back to it. I haven't revisited this logic since the first publish. Feel free to look around and suggest a PR with changes.

Riiight. I see it. Instead of explicitly setting the stepIndexes when showing just a subset of the onboarding steps, one would need to set something like a startAt and endAt index value. Then you wouldn't need to remove the index as you went but could just increase or decrease the currentIndex until it is above endAt or below startAt... Something like that. I might try to do a PR if I have time.

Although the downside of this would be that you would have to run a sequential set of indexes (as now you can pick and choose which ones to show with the explicit list.

Right, and I have made it support an arbitrary list of indexes not necessarily in order. See showWithIndexes