button callback #1382
Replies: 4 comments
-
| @bobmanc not only is there a way, there are several ways. My recommendation would be to check out |
Beta Was this translation helpful? Give feedback.
0 replies
-
| Thanks Robert, This looks like exactly what I need. I tried this... This works and shows the next step buttons: [ { text: 'Next', action: tour.next } ] This does nothing buttons: [ { text: 'Next', action: () => { return this.next; } } ] This shows the alert and then nothing happens so I know the code is being called. buttons: [ { text: 'Next', action: () => { alert('hey'); return this.next; } } ] What (probably obvious) thing am I doing wrong? Thanks for your help …On Fri, Mar 26, 2021 at 9:05 AM Robert Wagner ***@***.***> wrote: @bobmanc <https://github.com/bobmanc> not only is there a way, there are several ways. My recommendation would be to check out button.action in the docs https://shepherdjs.dev/docs/Step.html — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1382 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAQIE7WTWUMW5GCDHOJ7P53TFSBAPANCNFSM4Z2RVW6A> . |
Beta Was this translation helpful? Give feedback.
0 replies
-
| well this does work! action: function() { return tour.next(); } …On Fri, Mar 26, 2021 at 11:45 AM Bob Mancarella ***@***.***> wrote: Thanks Robert, This looks like exactly what I need. I tried this... This works and shows the next step buttons: [ { text: 'Next', action: tour.next } ] This does nothing buttons: [ { text: 'Next', action: () => { return this.next; } } ] This shows the alert and then nothing happens so I know the code is being called. buttons: [ { text: 'Next', action: () => { alert('hey'); return this.next; } } ] What (probably obvious) thing am I doing wrong? Thanks for your help On Fri, Mar 26, 2021 at 9:05 AM Robert Wagner ***@***.***> wrote: > @bobmanc <https://github.com/bobmanc> not only is there a way, there are > several ways. My recommendation would be to check out button.action in > the docs https://shepherdjs.dev/docs/Step.html > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <#1382 (comment)>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAQIE7WTWUMW5GCDHOJ7P53TFSBAPANCNFSM4Z2RVW6A> > . > |
Beta Was this translation helpful? Give feedback.
0 replies
-
| @bobmanc the issue is you were using an arrow function, which rebinds You want: action() { this.next(); } |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to run some javascript code after a next button is pressed?
Beta Was this translation helpful? Give feedback.
All reactions