fix(focus-monitor): hitting ngzone when using focusVia (#10608)

Currently most of the timeouts inside the `FocusMonitor` are run outside the `NgZone`, because they're called from event listeners that are bound on the outside, however the one from `_setOriginForCurrentEventQueue` can still end up inside when it's called by `focusVia`.
This commit is contained in:
Kristiyan Kostadinov
2018-04-05 17:04:43 +02:00
committed by Jeremy Elbourn
parent 46ca6ce717
commit b38b966b92
+4 -2
View File
@@ -240,8 +240,10 @@ export class FocusMonitor implements OnDestroy {
* @param origin The origin to set.
*/
private _setOriginForCurrentEventQueue(origin: FocusOrigin): void {
this._origin = origin;
this._originTimeoutId = setTimeout(() => this._origin = null, 0);
this._ngZone.runOutsideAngular(() => {
this._origin = origin;
this._originTimeoutId = setTimeout(() => this._origin = null, 0);
});
}
/**