turbolinks-animate icon indicating copy to clipboard operation
turbolinks-animate copied to clipboard

Page disappears after a click on a mailto/download link

Open jonhue opened this issue 6 years ago • 1 comments

Should have been fixed with 32ce60a7f9c17061b506b2848a159a4e5e838138.

Because of some reason it's still not working.

The same goes for download links.

jonhue avatar Mar 28 '18 12:03 jonhue

We already have to set "data-turbolinks=false" on all download links so that turbolinks doesn't try to interpret the downloaded file as html. Having that attribute to rely on I just added this to your mailto fix and it seems to work: document.querySelectorAll('a[data-turbolinks=false]').forEach((element) => element.addEventListener('click', () => ignoreBeforeunload = true)); I don't know enough about the internals of Turbolinks or TAnimate to say if this is a generic fix though.

Edit: Just found out the "download" attribute on an anchor is recognised by turbolinks and is probably a better replacement for "data-turbolinks=false".

Armarr avatar Jul 30 '19 08:07 Armarr