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

[5.x] Avoid infinite digest loop caused by $watch and $timeout #10119

Merged
merged 1 commit into from
Jan 31, 2017

Conversation

elastic-jasper
Copy link
Contributor

Avoid infinite digest loop caused by $watch and $timeout

Backports PR #10036

Commit 1:
Avoid infinite digest loop in debounce

The custom debounce implementation uses Angular's $timeout, which
interacts unfavourably with the unconditional $watch handler used in
the fixed-scroll directive. It results in an infinite digest being
triggered about every 100ms. To avoid that, this commit uses the
invokeApply option of $timeout and instead calls $scope.$apply
conditionally.

Backports PR #10036

**Commit 1:**
Avoid infinite digest loop in debounce

The custom debounce implementation uses Angular's `$timeout`, which
interacts unfavourably with the unconditional `$watch` handler used in
the `fixed-scroll` directive. It results in an infinite digest being
triggered about every 100ms. To avoid that, this commit uses the
`invokeApply` option of `$timeout` and instead calls `$scope.$apply`
conditionally.

* Original sha: 13c677d
* Authored by Felix Stürmer <stuermer@weltenwort.de> on 2017-01-24T11:30:41Z
@weltenwort weltenwort force-pushed the jasper/backport/10036/5.x branch from 4ac91d9 to a5741bc Compare January 31, 2017 15:19
@weltenwort weltenwort merged commit 89d2b38 into 5.x Jan 31, 2017
@epixa epixa deleted the jasper/backport/10036/5.x branch February 8, 2017 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants