You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but it's weird that it doesn't trigger at 767 since there is 1px subtracted from the breakpoint width: window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
maybe also open an issue at shadcn/ui so it will stay consistent :)
When I expand the window slowly, the
isMobile
doesn't change tofalse
.Add
console.log(window.innerWidth, e.matches)
get767 false
, butMOBILE_BREAKPOINT
is768
, so setIsMobile istrue
.Use
event.matches
ormql.matches
or?<=
I find a questions: html - Media query max-width not working inclusively - Stack Overflow. You can see: https://jsfiddle.net/e0hdyqc9/, the
767
is white.Maybe with
max-width
when the number is even, media match includes the number; when the number is odd, media match doesn't include the number.The text was updated successfully, but these errors were encountered: