This repository was archived by the owner on Jan 6, 2025. It is now read-only.
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
[Chrome] MediaObserver asObservable() emit wrong events on breakpoints #1059
Open
Description
Bug Report
What is the expected behavior?
When I resize the screen from 959px to 960px, MediaObserver.asObservable() should emit a MediaChange event with mqAlias="md"
What is the current behavior?
When I resize the screen from 959px to 960px, MediaObserver.asObservable() emits (among others) 2 MediaChange events with mqAlias="md" and mqAlias="sm"
What are the steps to reproduce?
A component with
public ngOnInit() {
this.watcher = this.mediaObserver.asObservable()
.subscribe((changes: MediaChange[]) => {
console.log(changes)
})
}
What is the use-case or motivation for changing an existing behavior?
When I resize slowly, MediaObserver.media$ does not always emit an event when breakpoints are crossed. I think it may be related.
Is there anything else we should know?
It may be related to the recent changes about the breakpoints (i.e. max-width: 959.99 instead of 959)
fxLayout version: 7.0.0-beta.24