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

fix(core): correctly emit MediaChange events #1113

Conversation

paulotokimatu
Copy link

Related to #1059

Before:

https://imgur.com/CjYklut

Notice that both sm and md MediaQueries are activated.

After:

https://imgur.com/qKH32Lg

MediaObserver was showing an inconsistent behavior of the public `asObservable` method, emitting incorrect MediaChange events. For example, it was possible to receive both `sm` and `md` events at the same time as you resize your screen.

Related to angular#1059
@paulotokimatu paulotokimatu changed the title fix(core): correctly emit MediaChange events [WIP] fix(core): correctly emit MediaChange events Aug 19, 2019
@paulotokimatu
Copy link
Author

@ThomasBurleson Do you think there is any issue reverting the dueTime from 0 to 10?

@paulotokimatu paulotokimatu changed the title [WIP] fix(core): correctly emit MediaChange events fix(core): correctly emit MediaChange events Aug 19, 2019
@paulotokimatu
Copy link
Author

@CaerusKaru Very sorry for bothering you, just pinging for feedback.

@epelc
Copy link
Contributor

epelc commented Sep 27, 2019

@paulotokimatu are you sure this is the correct way to fix this? It looks like debounceTime was used to switch the scheduler. Changing 0 to 10ms seems like it would have unintended consequences ie make it racy on slower devices.

@CaerusKaru
Copy link
Member

I agree this isn't the correct solution. I appreciate your putting the time in to create this PR, and would be happy to work with you to get the correct fix in.

@CaerusKaru CaerusKaru closed this May 8, 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 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants