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

fix: Drift not hiding if shown when destroyed #291

Merged
merged 2 commits into from
Jul 28, 2019

Conversation

vetruvet
Copy link
Contributor

@vetruvet vetruvet commented Jul 25, 2019

Breaking change?: NO
Fixes #60, #73

Description

If Drift is shown when destroy is called, the events get unbound but elements don't get hidden. This results in unresponsive visual elements that hang around.

This fixes the issue by calling _hide on the trigger object.

Checklist

  • All existing unit tests are still passing (if applicable)
  • Add new passing unit tests to cover the code introduced by your PR
  • Update the readme (n/a?)
  • Update or add any necessary API documentation (n/a?)
  • Add some steps so we can test your bug fix
  • The PR title is in the conventional commit format: e.g. fix(<area>): fixed bug #issue-number
  • Add your info to the contributors array in package.json!

Steps to Test

  1. Set up Drift
  2. Hover over target element
  3. Call destroy (e.g. on a setTimeout for testing)
  4. See that Drift's elements are hidden properly.

Copy link
Contributor

@sherwinski sherwinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @vetruvet! This looks good to me overall but there's just one breaking test that needs to be fixed before we can merge this.

test/testDrift.js Show resolved Hide resolved
@vetruvet
Copy link
Contributor Author

Thanks for the linter fix @sherwinski. My bad for for not checking lint first.

Though, I would say an easier and more sustainable way would be to add an .eslintrc.json file to the test directory and specify { "env": { "jasmine": true } } in there. That way you would not need to manage the globals list at the top of each file. If you would like, I can make a separate PR with this change.

@sherwinski sherwinski merged commit e217752 into strawdynamics:master Jul 28, 2019
@sherwinski
Copy link
Contributor

@vetruvet no problem! And totally agree with your suggestion, I would gladly take a PR for that. Thanks

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

Successfully merging this pull request may close these issues.

Properly destroying Drift
2 participants