mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(focus-trap): avoid closure compiler issues when adding anchors (#3448)
This commit is contained in:
committed by
Kara
parent
02f4bc3730
commit
8b2ae0d8aa
@@ -72,13 +72,11 @@ export class FocusTrap {
|
||||
}
|
||||
|
||||
this._ngZone.runOutsideAngular(() => {
|
||||
this._element
|
||||
.insertAdjacentElement('beforebegin', this._startAnchor)
|
||||
.addEventListener('focus', () => this.focusLastTabbableElement());
|
||||
this._startAnchor.addEventListener('focus', () => this.focusLastTabbableElement());
|
||||
this._endAnchor.addEventListener('focus', () => this.focusFirstTabbableElement());
|
||||
|
||||
this._element
|
||||
.insertAdjacentElement('afterend', this._endAnchor)
|
||||
.addEventListener('focus', () => this.focusFirstTabbableElement());
|
||||
this._element.parentNode.insertBefore(this._startAnchor, this._element);
|
||||
this._element.parentNode.insertBefore(this._endAnchor, this._element.nextSibling);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user