-
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
BreakpointObserver.observe
emits twice for adjacent breakpoints
#10925
Comments
BreakpointObserver
emits twiceBreakpointObserver.observe
emits twice for adjacent breakpoints
TrevorKarjanis
added a commit
to TrevorKarjanis/components
that referenced
this issue
May 3, 2019
…accuracy The breakpoint observer emits multiple and incorrect states when more than one query changes. Debounce the observer emissions to eliminate the incorrect states and emit once. References angular#10925
TrevorKarjanis
added a commit
to TrevorKarjanis/components
that referenced
this issue
May 6, 2019
…accuracy The breakpoint observer emits multiple and incorrect states when more than one query changes. Debounce the observer emissions to eliminate the incorrect states and emit once. References angular#10925
TrevorKarjanis
added a commit
to TrevorKarjanis/components
that referenced
this issue
May 7, 2019
…accuracy The breakpoint observer emits multiple and incorrect states when more than one query changes. Debounce the observer emissions to eliminate the incorrect states and emit once. References angular#10925
TrevorKarjanis
added a commit
to TrevorKarjanis/components
that referenced
this issue
May 21, 2019
…accuracy The breakpoint observer emits multiple and incorrect states when more than one query changes. Debounce the observer emissions to eliminate the incorrect states and emit once. References angular#10925
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug, feature request, or proposal:
Bug
What is the expected behavior?
BreakpointObserver.observe
stream should only return a single combined value based on the queries provided.What is the current behavior?
BreakpointObserver.observe
sometimes returns twice, particularly if two media queries are adjacent to each other, such is the case of something likeWhat are the steps to reproduce?
I've created a StackBlitz reproducing the problem. When commenting-out
Breakpoints.XSmall
, which is the only max-width-only ((max-width: Npx)
) query, it seems to stop double-emitting, but not sure yet ifmax-width
-only queries are the culprit.https://stackblitz.com/edit/angular-hdpu9f?file=app%2Fapp.component.ts
What is the use-case or motivation for changing an existing behavior?
Avoiding double emission where unnecessary.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Repro packages are listed in Stackblitz as well, but here's the summary:
Is there anything else we should know?
Also brought up at #10791 (comment).
The text was updated successfully, but these errors were encountered: