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

"shepherd-enabled" class is not removed from body element when tour ends #1131

Closed
IWMTom opened this issue Sep 4, 2020 · 3 comments · Fixed by #1132
Closed

"shepherd-enabled" class is not removed from body element when tour ends #1131

IWMTom opened this issue Sep 4, 2020 · 3 comments · Fixed by #1132
Labels

Comments

@IWMTom
Copy link
Contributor

IWMTom commented Sep 4, 2020

Reproducible on the Shepherd demo site: https://shepherdjs.dev/

Reach the end of the demo and inspect the body element - "shepherd-enabled" will still be set.

This is causing an issue in a project where we disable some scrollbars on certain elements if shepherd-enabled is set on the body. As it's never removed, the scrollbars remain disabled when the tour has been completed/cancelled.

@IWMTom
Copy link
Contributor Author

IWMTom commented Sep 4, 2020

After further debugging, the issue seems to occur when a step isn't attached to a specific element (i.e. we want the modal to be centered on the screen, either as an introductory or final step).

I believe it may be due to the fact in _show(), the target used to add the class has a fallback:
const target = this.target || document.body

However in _updateStepTargetOnHide() there is no fallback, and this.target is referred to directly. Presumably this is why the class is never removed from the body element.

@RobbieTheWagner
Copy link
Member

@IWMTom thanks for reporting this! Sounds like you have a good idea of what could be wrong. Would you like to open a PR to fix it?

@IWMTom
Copy link
Contributor Author

IWMTom commented Sep 4, 2020

@IWMTom thanks for reporting this! Sounds like you have a good idea of what could be wrong. Would you like to open a PR to fix it?

Happy to! Will revert back with a PR this evening.

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