JohnCoene / cicerone

🏛️ Give tours of your Shiny apps
https://cicerone.john-coene.com
Other
187 stars 7 forks source link

Unable to move to next to screen #24

Closed shuwei325 closed 1 year ago

shuwei325 commented 3 years ago

Dear John,

I'm developing an App and I need to include a step by step guide involving different navbar and tabs. I tried the argument tab and tab_id following this Tab guide.

I'm sure I'm using the 1.0.4 version and by using exactly the same code provided in this page, I cannot go to the second step (which is in the summary_tab) by clicking on the "Next" button. Is anyone else have this problem?

Thank you for your time and consideration.

KoderKow commented 3 years ago

I am encountering this as well, using the first example I cannot get the code to switch to the second tab and I cannot get this method to work in my own app. Is there a new approach for switch tabs during a tour? :)

JohnCoene commented 3 years ago

Yes, there are some issues.

Apologies.

I will come around to fixing these for the next release. I know the author of the underlying JavaScript library is overhauling the API, as soon as this is done I shall do the same with {cicerone} so it is much more robust.

etiennebacher commented 2 years ago

Hi @JohnCoene, I found the problem for this (also mentioned in #31) but I don't know Javascript enough to fix it. It comes from these lines:

https://github.com/JohnCoene/cicerone/blob/4791dd6f411e2aec765f8e38522e7c4b9085fe16/srcjs/exts/cicerone.js#L99-L104

https://github.com/JohnCoene/cicerone/blob/4791dd6f411e2aec765f8e38522e7c4b9085fe16/srcjs/exts/cicerone.js#L110-L112

Removing

opts.steps[index].onHighlightStarted = new Function("return " + opts.steps[index].onHighlightStarted)();

makes it work (tabs change when we click on "Next"). I hope it helps to fix it

lhabegger commented 1 year ago

@etiennebacher I needed this feature to work together with the bs4Dash framework. After some digging I found a way that makes it work for me (submitted as PR #51 ):

https://github.com/JohnCoene/cicerone/blob/66fc2baebb08a1eee9388e0d0d5336b9da148238/srcjs/exts/cicerone.js#L98:L105

to make it work for bs4Dash I had to additionally adjust the call to the Input binding as follows: Shiny.inputBindings.bindingNames['bs4Dash.tabItemInput'].binding.setValue(tabs, step.tab);