Skip to content

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

Merged
weltenwort merged 1 commit into5.xfrom
jasper/backport/10036/5.x
Jan 31, 2017
Merged

[5.x] Avoid infinite digest loop caused by $watch and $timeout#10119
weltenwort merged 1 commit into5.xfrom
jasper/backport/10036/5.x

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.

@elastic-jasper elastic-jasper added backport This PR is a backport of another PR has conflicts labels Jan 31, 2017
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

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants