mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
committed by
Jeremy Elbourn
parent
46ca6ce717
commit
b38b966b92
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user