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

Match does not trigger on subsequent change of orientation. #109

Closed
Bitneko opened this issue Mar 25, 2014 · 5 comments
Closed

Match does not trigger on subsequent change of orientation. #109

Bitneko opened this issue Mar 25, 2014 · 5 comments

Comments

@Bitneko
Copy link

Bitneko commented Mar 25, 2014

EnquireJS work as expected when orientation has changed, either from landscape to portrait or from portrait to landscape. However this only work the first time the orientation has changed, on subsequent change of orientation, matches stop triggering.

Problem is observed on a ipad2 running ios 7 mobile safari.

The following is the code snippet i'm running

enquire.register('screen and (min-width: 1024px)', {
    match : function() {
        rr.menu.desktop();
    }
}, true);

enquire.register('screen and (max-width: 1023px)', {
    match : function() {
        rr.menu.mobile();
    }
});

Any idea?

@WickyNilliams
Copy link
Owner

Are you still having an issue?

@veke
Copy link

veke commented May 19, 2014

I'm having this same behaviour. iPad3 on ios7 latest with safari and chrome.
The orientation change triggers the match only one time.

@veke
Copy link

veke commented May 19, 2014

My situation is this:

I have an image gallery which calculates some heights for elements in window resize. I have noticed that when the gallery is active, the match triggers correctly every time the match happens. But when the page has no gallery, the match function triggers only the first time. I bet the page repaint is somehow involved in this matter.

Tested with version 2.1.1 and 2.1.0

@veke
Copy link

veke commented May 22, 2014

This solved my case: http://devrandom.com/test/ios7-matchmedia/fixed.html
The script in that page which creates element and on resize event calculates the width and forces repaint helped.
Similar symptoms #79

@WickyNilliams
Copy link
Owner

Thanks for the input @vennamo. I think a shim as you described is the best thing to do rather than add hacks to enquire itself.

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