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

Modernizr says flex-wrap is supported in UC on Android #2205

Open
ethanroday opened this issue May 15, 2017 · 8 comments
Open

Modernizr says flex-wrap is supported in UC on Android #2205

ethanroday opened this issue May 15, 2017 · 8 comments

Comments

@ethanroday
Copy link

Modernizr does not seem to detect that flex-wrap is not supported in UC Browser for Android (http://caniuse.com/#search=flex).

With the following CSS, the background color of a page loaded in UC does not change:

.mod-no-flexwrap body {
    background-color: red;
}

Similarly, with .mod-flexwrap, the background color does change where it shouldn't.

(I am using the following custom build: https://modernizr.com/download/?-flexbox-flexwrap-setclasses-cssclassprefix:mod-)

@ethanroday
Copy link
Author

Just to add to the confusion, UC says it does support flex-wrap:

var wrapIsSupported = document.createElement("div").style.flexWrap !== undefined;
//wrapIsSupported is true

@patrickkettner
Copy link
Member

hey @ethanroday!
Are you using testing US Browser or UC Browser mini?

@hexalys
Copy link

hexalys commented May 16, 2017

@patrickkettner
It's for UCWeb Android (the U3 Engine). They somehow expose newer Webkit properties w/o the support.

FYI: I have managed to solve this by discarding flexBasis or flexWrapwith:
('CSS' in win && 'supports' in CSS)

I myself rely on a detect of UCWeb to be sure. However I think it could work for you without it, since CSS.supports matches or prerequisite flexWrap support in others browsers. Otherwise, it may fall as undetectable for Modernizr.

@patrickkettner
Copy link
Member

Thanks for the info @hexalys!

Otherwise, it may fall as undetectable for Modernizr.

image

We would just need to flex-wrap something with a known width and height and check the height of the container element
.

@hexalys
Copy link

hexalys commented May 16, 2017

Ah yeah, you could do that too. :) It seems too expensive, for my taste anyway.

@patrickkettner
Copy link
Member

we do it in a number of places. some folks need accuracy

@ethanroday
Copy link
Author

@patrickkettner Seeing a meme in a Github issue thread rather made my day. Seems like @hexalys answered your question, but let me know if you need any more information from me.

@patrickkettner
Copy link
Member

@ethanroday we are good! :]

Going to see if UC could possibly change their behavior, and if not we will update our code accordingly

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