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

Destroying visible reveal does not remove is-reveal-open class from body. #10626

Closed
GCheung55 opened this issue Sep 7, 2017 · 3 comments
Closed

Comments

@GCheung55
Copy link

How to reproduce this bug:

  1. Click on the button to open the modal.

  2. With JS, destroy the open reveal element.

$('#exampleModal11').foundation('destroy');
  1. Confirm modal is destroyed.
  2. Check body element for is-reveal-open class.

What should happen:

Destroying the reveal element should remove the is-reveal-open class from the body element.

What happened instead:

body element retains is-reveal-open class after the reveal element is destroyed.

Browser(s) and Device(s) tested on:

Chrome 60.0.3112.113

Foundation Version(s) you are using:

6.4.3

Test case link:

https://codepen.io/anon/pen/WEqOrB - inside the modal is a link with a click event that destroys the reveal element. It will also print out a boolean determined by whether the body element has the is-reveal-open class or not.

Basically the _destroy method does not cleanup the is-reveal-open class, where as the finishUp method does.

@Arredatore
Copy link

Could it be linked to my topic? I also experience trouble with reveal #10617

@iapassas
Copy link

You may consider the following
var alrt = new Foundation.Reveal($('#myReveal'));
alrt.close();
if ($('body').hasClass('is-reveal-open')) { $('body').removeClass('is-reveal-open'); }
var bl = $('.reveal-overlay').filter(function() { return $(this).css('display') == 'block'; });
$(bl).remove();

@drball
Copy link
Contributor

drball commented Jan 3, 2018

I was having this problem and solved it by removing these animation effects on the reveal element:
data-animation-in="fade-in-fast" data-animation-out="fade-out"

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

No branches or pull requests

6 participants