mq-polyfill
mq-polyfill copied to clipboard
Polyfilled matchMedia never matches float "max-width" queries
Whenever passing a float as the value of a max-width
query, matches
returns false
even when the test should pass. Tested this with both px
and em
based queries.
Expected behavior:
// After polyfilling matchMedia
window.innerWidth = 700;
window.outerWidth = 700;
window.matchMedia('(max-width: 2.5em)').matches; // => true
Actual behavior:
// After polyfilling matchMedia
window.innerWidth = 700;
window.outerWidth = 700;
window.matchMedia('(max-width: 2.5em)').matches; // => false
window.matchMedia('(max-width: 3em)').matches; // => true
To add to the above, float min-width
queries always match
Was there any movement on this?