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

Added default fallback for target when step is hidden/destroyed #1132

Merged

Conversation

IWMTom
Copy link
Contributor

@IWMTom IWMTom commented Sep 4, 2020

Fixes #1131

If a step is added without specifically specifying an element to attach to, there was a default to fallback to document.body.
When a step was hidden/destroyed, this.target was checked which in the case of a non-attached step, this.target was null.

  • Added a fallback to document.body if this.target is falsey when hiding/destroying a step
  • Removed condition of this.target being truthy for calls to _updateStepTargetOnHide()
  • Added unit tests to cover this scenario. Validated that the test failed prior to the fix, and that the test now passes.

Tom Wilson added 2 commits September 4, 2020 22:24
@RobbieTheWagner
Copy link
Member

Thanks for the PR!

@RobbieTheWagner RobbieTheWagner merged commit bd13413 into shipshapecode:master Sep 5, 2020
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 this pull request may close these issues.

"shepherd-enabled" class is not removed from body element when tour ends
2 participants