Skip to content

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

Merged
RobbieTheWagner merged 2 commits intoshipshapecode:masterfrom
IWMTom:fix/Shepherd-Enabled-Class-Body
Sep 5, 2020
Merged

Added default fallback for target when step is hidden/destroyed#1132
RobbieTheWagner merged 2 commits intoshipshapecode:masterfrom
IWMTom:fix/Shepherd-Enabled-Class-Body

Conversation

@IWMTom
Copy link
Copy Markdown
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
Copy Markdown
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