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

ObservableMedia does not emit when largest viewport is active #275

Closed
TylerDev6 opened this issue May 3, 2017 · 7 comments
Closed

ObservableMedia does not emit when largest viewport is active #275

TylerDev6 opened this issue May 3, 2017 · 7 comments
Assignees
Labels
has pr A PR has been created to address this issue P0 Critical issue that needs to be resolved immediately
Milestone

Comments

@TylerDev6
Copy link

This seems to be happening with custom breakpoints and I'm using 2.0.0-beta6, but it may still be happening with other instances as well.

Here's a plunker that shows the custom breakpoints. Scaling the app up and down shows that events are emitted to console for small and medium, but not the largest size.

https://plnkr.co/edit/WvZtQ024vu2R816EMPQD?p=preview

@ThomasBurleson
Copy link
Contributor

ThomasBurleson commented May 3, 2017

@TylerDev6 -
Your non-overlapping breakpoint ranges appear to be wrong

[{
    alias: 'xs',
    mediaQuery: 'screen and (max-width: 767px)'
}, {
    alias: 'sm',
    mediaQuery: 'screen and (max-width: 767px)'
}, {
    alias: 'md',
    mediaQuery: 'screen and (min-width: 768px) and (max-width: 1023px)'
}, {
    alias: 'lg',
    mediaQuery: 'screen and (min-width: 1024px)'
}, {
    alias: 'xl',
    mediaQuery: 'screen and (min-width: 1024px)'
}]

^ they are overlapping and often the same. Non-overlapping ranges must have distinct, unique, non-overlapping range values.

@TylerDev6
Copy link
Author

right, that was a problem I had encountered. As you can see, I only really need 3 breakpoints but the API indicates that I must provide all 5. Since I didn't want layout changes triggered by the default xs and xl breakpoints I overrode them.

@TylerDev6
Copy link
Author

However, why would that actually cause the behaviour I'm seeing? xs / sm overlap but I still get emits for xs.... lg and xl overlap but I don't get emits for either.

@ThomasBurleson
Copy link
Contributor

Related to #245

@ThomasBurleson ThomasBurleson added this to the v2.0.0-beta.9 milestone Jun 8, 2017
@ThomasBurleson ThomasBurleson self-assigned this Jun 8, 2017
@ThomasBurleson ThomasBurleson added the P0 Critical issue that needs to be resolved immediately label Jun 8, 2017
@ThomasBurleson
Copy link
Contributor

Will be fixed with PR #313.

See working plunker: https://plnkr.co/edit/yylQr2IdbGy2Yr00srrN?p=preview

@ThomasBurleson ThomasBurleson added has pr A PR has been created to address this issue and removed in-progress labels Jun 10, 2017
ThomasBurleson added a commit that referenced this issue Jun 10, 2017
ObservableMedia only dispatches notifications for activated, non-overlapping breakpoints.
If the MatchMedia lastReplay value is an *overlapping* breakpoint
(e.g. `lt-md`, `gt-lg`) then that value will be filtered by ObservableMedia
and not be emitted to subscribers.

* MatchMedia breakpoints registration was not correct
  *  overlapping breakpoints were registered in the wrong order
  * non-overlapping breakpoints should be registered last; so the BehaviorSubject's last replay value should be an non-overlapping breakpoint range.

> See working plunker:  https://plnkr.co/edit/yylQr2IdbGy2Yr00srrN?p=preview

Fixes #245, #275.
ThomasBurleson added a commit that referenced this issue Jun 12, 2017
ObservableMedia only dispatches notifications for activated, non-overlapping breakpoints.
If the MatchMedia lastReplay value is an *overlapping* breakpoint
(e.g. `lt-md`, `gt-lg`) then that value will be filtered by ObservableMedia
and not be emitted to subscribers.

* MatchMedia breakpoints registration was not correct
  *  overlapping breakpoints were registered in the wrong order
  * non-overlapping breakpoints should be registered last; so the BehaviorSubject's last replay value should be an non-overlapping breakpoint range.
* Optimize stylesheet injection to group `n` mediaQuerys in a single stylesheet

> See working plunker:  https://plnkr.co/edit/yylQr2IdbGy2Yr00srrN?p=preview

Fixes #245, #275, #303
ThomasBurleson added a commit that referenced this issue Jun 12, 2017
ObservableMedia only dispatches notifications for activated, non-overlapping breakpoints.
If the MatchMedia lastReplay value is an *overlapping* breakpoint
(e.g. `lt-md`, `gt-lg`) then that value will be filtered by ObservableMedia
and not be emitted to subscribers.

* MatchMedia breakpoints registration was not correct
  *  overlapping breakpoints were registered in the wrong order
  * non-overlapping breakpoints should be registered last; so the BehaviorSubject's last replay value should be an non-overlapping breakpoint range.
* Optimize stylesheet injection to group `n` mediaQuerys in a single stylesheet

> See working plunker:  https://plnkr.co/edit/yylQr2IdbGy2Yr00srrN?p=preview

Fixes #245, #275, #303
ThomasBurleson added a commit that referenced this issue Jun 12, 2017
ObservableMedia only dispatches notifications for activated, non-overlapping breakpoints.
If the MatchMedia lastReplay value is an *overlapping* breakpoint
(e.g. `lt-md`, `gt-lg`) then that value will be filtered by ObservableMedia
and not be emitted to subscribers.

* MatchMedia breakpoints registration was not correct
  *  overlapping breakpoints were registered in the wrong order
  * non-overlapping breakpoints should be registered last; so the BehaviorSubject's last replay value should be an non-overlapping breakpoint range.
* Optimize stylesheet injection to group `n` mediaQuerys in a single stylesheet

> See working plunker:  https://plnkr.co/edit/yylQr2IdbGy2Yr00srrN?p=preview

Fixes #245, #275, #303
ThomasBurleson added a commit that referenced this issue Jun 13, 2017
ObservableMedia only dispatches notifications for activated, non-overlapping breakpoints.
If the MatchMedia lastReplay value is an *overlapping* breakpoint
(e.g. `lt-md`, `gt-lg`) then that value will be filtered by ObservableMedia
and not be emitted to subscribers.

* MatchMedia breakpoints registration was not correct
  *  overlapping breakpoints were registered in the wrong order
  * non-overlapping breakpoints should be registered last; so the BehaviorSubject's last replay value should be an non-overlapping breakpoint range.
* Optimize stylesheet injection to group `n` mediaQuerys in a single stylesheet

> See working plunker:  https://plnkr.co/edit/yylQr2IdbGy2Yr00srrN?p=preview

Fixes #245, #275, #303
ThomasBurleson added a commit that referenced this issue Jun 13, 2017
ObservableMedia only dispatches notifications for activated, non-overlapping breakpoints.
If the MatchMedia lastReplay value is an *overlapping* breakpoint
(e.g. `lt-md`, `gt-lg`) then that value will be filtered by ObservableMedia
and not be emitted to subscribers.

* MatchMedia breakpoints registration was not correct
  *  overlapping breakpoints were registered in the wrong order
  * non-overlapping breakpoints should be registered last; so the BehaviorSubject's last replay value should be an non-overlapping breakpoint range.
* Optimize stylesheet injection to group `n` mediaQuerys in a single stylesheet

> See working plunker:  https://plnkr.co/edit/yylQr2IdbGy2Yr00srrN?p=preview

Fixes #245, #275, #303
@ThomasBurleson
Copy link
Contributor

Fixed with SHA 00ac57a

@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 Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has pr A PR has been created to address this issue P0 Critical issue that needs to be resolved immediately
Projects
None yet
Development

No branches or pull requests

2 participants