| 150 | } |
| 151 | |
| 152 | ngAfterViewInit() { |
| 153 | // We use the focus monitor because we also want to style |
| 154 | // things differently based on the focus origin. |
| 155 | this._focusMonitor.monitor(this._elementRef, true).subscribe(() => { |
| 156 | // We need the delay here, because we can trigger a signal write error if the header |
| 157 | // has a signal bound to `disabled` which causes it to be blurred (see #31723.) |
| 158 | Promise.resolve().then(() => this._recentlyCleared.set(null)); |
| 159 | }); |
| 160 | } |
| 161 | |
| 162 | ngOnDestroy() { |
| 163 | this._focusMonitor.stopMonitoring(this._elementRef); |