Gbuomprisco / ngx-chips

Tag Input component for Angular
MIT License
899 stars 360 forks source link

onFocus event emitting bug #924

Open dm-gthb opened 4 years ago

dm-gthb commented 4 years ago

PLEASE MAKE SURE THAT:

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] support request/question

Notice: feature requests will be ignored, submit a PR if you'd like

Current behavior onFocus event isn't emitted when the input is focused using the tab key in case without any tags added. It fired with some added tags or focused by click, but it doesn't using the tab and without tags.

Expected behavior Event fired when the input is focused using the tab key either with existing tags list or empty.

Minimal reproduction of the problem with instructions (if applicable) Here when input is focused using the tab, onFocus won't be emitted and code in onInputFocused won't be executed:

@Component({
  selector: 'test',
  template: '<tag-input [(ngModel)]="items" (onFocus)="onInputFocused()"></tag-input>',
})
export class TestComponent {
  items = [];
  onInputFocused() {
    // code to execute
  }
}

What do you use to build your app?. Please specify the version angular-cli

Angular version: 8

ngx-chips version: 2.1.0

Browser: [Chrome 79 | Firefox 72 | Safari 13]