We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63d4359 commit 94adecdCopy full SHA for 94adecd
src/lib/core/style/focus-origin-monitor.ts
@@ -102,12 +102,15 @@ export class FocusOriginMonitor {
102
* @param element The element to stop monitoring.
103
*/
104
unmonitor(element: Element): void {
105
- if (!this._elementInfo.has(element)) {
106
- return;
+ let elementInfo = this._elementInfo.get(element);
+
107
+ if (elementInfo) {
108
+ elementInfo.unlisten();
109
+ elementInfo.subject.complete();
110
111
+ this._setClasses(element, null);
112
+ this._elementInfo.delete(element);
113
}
- this._elementInfo.get(element).unlisten();
- this._setClasses(element, null);
- this._elementInfo.delete(element);
114
115
116
/**
0 commit comments