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

is-reveal-open and turbolinks #290

Open
haroldus- opened this issue Feb 13, 2020 · 4 comments
Open

is-reveal-open and turbolinks #290

haroldus- opened this issue Feb 13, 2020 · 4 comments

Comments

@haroldus-
Copy link

  • place a link in your reveal modal to another part of your app enabled with turbolinks
  • click the link
  • sometimes the screen is frozen
  • inspect the html document and the is-reveal-open class is present
  • remove the class and all returns to normal

Perhaps there is a way to prevent this behaviour without a custom workaround.

@akaspick
Copy link

akaspick commented Mar 25, 2020

Same issue here. Destroying or closing the dialog in one of the turbolinks events before navigating away doesn't seem to remove the is-reveal-open class.

My current hack to deal with this is to just manually remove the class:

$(document).on('turbolinks:before-render', function() {
  $('html').removeClass('is-reveal-open')
})

@akaspick
Copy link

akaspick commented Apr 27, 2020

Well, I had some other issues with the modal not closing properly and now I've settled on the following as a solution that seems to work just fine now:

$(document).on('turbolinks:before-cache', function() {
  if (document.documentElement.classList.contains('is-reveal-open')) {
    $('#dialog').foundation('close')
  }
})

@akaspick
Copy link

Noticed more issues when using reveal and turbolinks. If you navigate to a page that uses a reveal modal, and then click back and then forward again via the history, multiple reveal divs are created with the same dom id. Even if you close the modal before navigating away, the multiple reveal divs appear.

I have no current solution for this so far.

@jokrah
Copy link

jokrah commented Feb 8, 2021

Any updates on this? It's still an issue using the latest versions for both

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

No branches or pull requests

3 participants