-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Max widths of certain breakpoints does not match any window BreakpointState #13719
Comments
Media queries use the viewport, not the window size. @HostListener('window:resize', ['$event'])
onResize(event) {
this.windowWidth = window.innerWidth;
} |
Ok thanks. The stackblitz code was updated, and all the states still returns false. |
For me it works. Have you tried a separate window? It's easier to change the size and observe the breakpoints. |
You can also reproduce this with zoom to 150%. If the unscaled width is 899px and you zoom to 150%, all values are false. Looks like a rounding problem to me. 899 / 1.5 = 599.33 which is greater than 599 and lower than 600. Same with Firefox and Edge. Edit: Seems to be an old problem. |
@josephperrott @media (max-width: 599.999999999px) {
.redfont {
color: red;
}
} https://stackblitz.com/edit/angular-material2-issue-breakpoints-states-pf5zlw |
Yep, thanks for the help. Closing this issue 👍 |
@datariomj Leave it open since there is a possibility to minimize the problem. |
Reopened. Can we change the label to something else instead of |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug: Max widths does not match any window BreakpointState
What is the expected behavior?
What is the current behavior?
What are the steps to reproduce?
https://stackblitz.com/edit/angular-material2-issue-breakpoints-states
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular: v7.0.0
Material: v7.0.0
Typescript: v3.1.3
OS: Windows 10
Browser: Version 69.0.3497.100 (Official Build) (64-bit)
Is there anything else we should know?
Please use the Open in New Window feature of stackblitz to view this issue.
The text was updated successfully, but these errors were encountered: