I am trying to get a reactive form to properly handle blur events and it doesn't seem to react properly to blur.
import { Component, HostListener, HostBinding } from '@angular/core';
@Component({
selector: 'app-combo-box-basic',
templateUrl: './combo-box-basic.html'
})
export class ComboBoxBasic {
@HostListener('blur', ['$event.target']) onBlur(target) {
console.log(`onBlur(): ${new Date()} - ${JSON.stringify(target)}`);
}
}
<div class="btn-group mr-3">
<input (blur)="onBlur($event.target)" type="text" class="btn btn-outline-success">
<div class="btn-group" ngbDropdown role="group" aria-label="Button group with nested dropdown">
<button (blur)="onBlur($event.target)" class="btn btn-outline-primary" ngbDropdownToggle></button>
<div class="dropdown-menu" ngbDropdownMenu>
<button class="dropdown-item">One</button>
<button class="dropdown-item">Two</button>
<button class="dropdown-item">Four!</button>
</div>
</div>
</div>