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

Windows Chrome V40.0.2214.94 m #240

Closed
avanriet opened this issue Jan 31, 2015 · 10 comments
Closed

Windows Chrome V40.0.2214.94 m #240

avanriet opened this issue Jan 31, 2015 · 10 comments

Comments

@avanriet
Copy link

The sidr menu won't open on this specific version of Chrome and only happens on Windows (tested Windows 8.1), all other browser (FF, Safari, IE work like a charm).
The according classes aren't added on the body like on the other browsers same as the needed css.

Does anyone know how to fix this or has the same issue?

Thanks in advance.

@bobreichard
Copy link

Yes, experiencing the same issue.

@rqbukhari
Copy link

I'm also experiencing the same issue. But sometime it works on Chrome as well. Very strange behavior. I can't see any error.

@promoinvideo
Copy link

Maybe I've got the problem: is it possible that you use a PC with both mouse and touchscreen? I had experienced the same issue and afer some investigation I realize that CHROME needs the CLICK event. I had modified the main js by adding the click event
$this.click(function (e) {
e.preventDefault();
methods.toggle(name);
});
after the line 316. I hope you can find this patch useful to solve your problem.

@pabeln
Copy link

pabeln commented May 1, 2015

Have the exact same issue as promoinvideo but using Chrome Version 42.0.2311.135 m (64-bit).

On PC with dual monitors and one is a touchscreen, the other is not and the mouse click event is ignored but the touch event is not. Also, if I go into Chrome dev tools and emulate a device and activate "Emulate touch screen", the touch events trigger Sidr.

I'll try to figure this out and post back shortly.

@maxpen
Copy link

maxpen commented May 1, 2015

Hopefully the author sees this and updates the code.

@pabeln
Copy link

pabeln commented May 1, 2015

The fix is pretty easy.

Change this: (starting on line 289)

if('ontouchstart' in document.documentElement) {
    $this.bind('touchstart', function(e) {
        var theEvent = e.originalEvent.touches[0];
        this.touched = e.timeStamp;
    });
    $this.bind('touchend', function(e) {
        var delta = Math.abs(e.timeStamp - this.touched);
        if(delta < 200) {
            e.preventDefault();
            methods.toggle(name);
        }
    });
}
else {
    $this.click(function(e) {
        e.preventDefault();
        methods.toggle(name);
    });
}

To This:

$this.bind('touchstart', function(e) {
    var theEvent = e.originalEvent.touches[0];
    this.touched = e.timeStamp;
});
$this.bind('touchend', function(e) {
    var delta = Math.abs(e.timeStamp - this.touched);
    if(delta < 200) {
        e.preventDefault();
        methods.toggle(name);
    }
});
$this.bind('click', function(e) {
    e.preventDefault();
    methods.toggle(name);
});

By removing the "ontouchstart" check I could bind both a click and a touch event to the element.

Keep in mind I only tested this in Chrome both emulation mode and not. Hope this helps others.

@maxpen
Copy link

maxpen commented May 1, 2015

@pabeln in what file do I apply this fix? jquery.sidr.min.js? Because that doesn't have (even when I use a unminify tool) a line 289.

@pabeln
Copy link

pabeln commented May 1, 2015

@master412160 I used the un-minified code here:
https://github.com/artberri/sidr/blob/master/src/jquery.sidr.js

@maxpen
Copy link

maxpen commented May 1, 2015

Thanks, got it.

artberri added a commit that referenced this issue Jan 9, 2016
…ixes #179 and fixes #266 and fixes #246 and fixes #245 and fixes #211 and fixes #178 and fixes #118 and fixes #98  and fixes #214 and fixes #117 and fixes #130 and fixes #144 and fixes #146 and fixes #165 and fixes #189 and fixes #193 and fixes #203 and fixes #213 and fixes #218 and fixes #240 and fixes #249
@artberri
Copy link
Owner

artberri commented Jan 9, 2016

Preparing a new version with a fix for this https://github.com/artberri/sidr/tree/reborn

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

7 participants