Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

custom breakpoint xs fails if min-width: 0px not specified #1050

Closed
alexfung888 opened this issue Apr 13, 2019 · 3 comments
Closed

custom breakpoint xs fails if min-width: 0px not specified #1050

alexfung888 opened this issue Apr 13, 2019 · 3 comments
Labels
custom breakpoints Issues with Custom Breakpoint configuration and use needs: investigation

Comments

@alexfung888
Copy link

alexfung888 commented Apr 13, 2019

Bug Report

What is the expected behavior?

when screen is smaller than max-width: 599.99px, media observer should next() xs.

What is the current behavior?

The changes array has LT-SM LT-MD, LT-LG and LT-XL, but without XS itself.

What are the steps to reproduce?

StackBlitz(https://stackblitz.com/edit/angular-flex-layout-breakpoint)

The changes$ array is displayed on screen. Adjust your output window to below 600px. It only shows

"LtSm"
"LtMd"
"LtLg"
"LtXl"

If you modify the my-break.points.module.ts to swap the two lines in the xs definition:

from
        mediaQuery: 'screen and (max-width: 599.99px)',
        // mediaQuery: 'screen and (min-width: 0px) and (max-width: 599.99px)',
to
        // mediaQuery: 'screen and (max-width: 599.99px)',
        mediaQuery: 'screen and (min-width: 0px) and (max-width: 599.99px)',

then XS will be detected correctly and displayed on screen.

"Xs"
"LtSm"
"LtMd"
"LtLg"
"LtXl"

What is the use-case or motivation for changing an existing behavior?

it is uncommon to specify min-width: 0px

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

flex-layout 7.0.0-beta.24
Angular 7.2.12
cdk 7.3.7
OS Windows 10
TS 311 and 324
browser Chrome

Is there anything else we should know?

@CaerusKaru
Copy link
Member

What's interesting about this is that at first glance, the behavior is non-deterministic. If you resize slowly, you will actually see Xs below 600px, but not every time.

My question is: does this impact anything other than MediaObserver?

@CaerusKaru CaerusKaru added custom breakpoints Issues with Custom Breakpoint configuration and use needs: investigation labels Jul 4, 2019
@CaerusKaru
Copy link
Member

Duplicate of #1059

@CaerusKaru CaerusKaru marked this as a duplicate of #1059 May 9, 2020
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
custom breakpoints Issues with Custom Breakpoint configuration and use needs: investigation
Projects
None yet
Development

No branches or pull requests

2 participants