Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing 'HTMLElement' to tour.addStep{ text: ... } doesn't work anymore #492

Closed
hope55 opened this issue Aug 8, 2019 · 4 comments · Fixed by #493
Closed

Passing 'HTMLElement' to tour.addStep{ text: ... } doesn't work anymore #492

hope55 opened this issue Aug 8, 2019 · 4 comments · Fixed by #493
Labels

Comments

@hope55
Copy link

hope55 commented Aug 8, 2019

Hi Robert, thanks for your awesome work! I tried to migrate my tour from 2.x to 4.4.0, but I couldn't. The documentation says:

The text in the body of the step. It can be one of three types:

- HTML string
- `HTMLElement` object
- `Function` to be executed when the step is built. It must return one the two options above.

Unfortunately the second option is broken now. It will render a tour step with a content text: "[object HTMLDivElement]". I must pass HTMLDivElement here, as it contains some elements having event handlers attached. (It is a progress bar).
One more important thing to mention: I might be wrong, but if this HTMLElement goes through an innerHTML transform, as I've seen in shepherd.js\src\js\components\shepherd-content\shepherd-text\index.jsx, event handlers get lost. It suppose it should use .appendChild() instead. (?)

@RobbieTheWagner
Copy link
Member

Hi @hope55 thanks for reporting the issue! I cannot seem to figure out how to do this with Preact. Any suggestions?

@hope55
Copy link
Author

hope55 commented Aug 9, 2019

Hey Robert! Thank you! That was really quick! Just tested it, it works like a charm! ;)

@RobbieTheWagner
Copy link
Member

@hope55 You're very welcome! Out of curiosity, where are you using Shepherd? We're always looking for more companies/projects to list as users 😃

@hope55
Copy link
Author

hope55 commented Aug 10, 2019

@rwwagner90 We've developed a Facility Management tool called SAM Space and Asset Management Service. My company is this: www.invensol.hu. Previously, we've had used Enjoyhint for site tours, but it has been abandoned by it's developer, in addition we wanted to get rid of jquery. Then I found Shepherd, with this great support! ;) Please feel free to list our company, if you think we fit in your portfolio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants