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

Long touch in iOS result sometime in new Safari window opening #824

Open
Marvin256 opened this issue Mar 14, 2016 · 1 comment
Open

Long touch in iOS result sometime in new Safari window opening #824

Marvin256 opened this issue Mar 14, 2016 · 1 comment
Labels

Comments

@Marvin256
Copy link

Hello

I'm using Ratchet on an iOS 9 web app and I have a bug that happens sometime: When a user does a long touch on a link, the new page is opened in a new window like a it was a target="_blank" link.

ex:

<a href="ageGate.html" data-transition="slide-in" id="step_home">

I'm using jQuery & Jquery Touch.

Does anyone had this behavior?

Thank you for your help

@kamihouse
Copy link

@Marvin256, using Ratchet 2.0.2 (note that the version of the "master" have changes over the labels), it is possible to solve with the code below.

With jQuery:

$(document).on('click', 'a[href]', function(event) {
    event.preventDefault();
});

Without jQuery:

var a = document.querySelectorAll('a[href]');
for (var i = 0; i < a.length; i++) {
    a[i].onclick = function() {
        return false;
    }
}

@cvrebert cvrebert added the js label Jun 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants