Reputation: 237
I've implemented some autocomplete with the NgbTypeahaed
bootstrap lib and it works fine. Now i'm trying to attach onScreen virtual keyboard, but I have no idea how to connect between them since the NgbTypeahaed
firing the event from input's attribute --> [ngbTypeahead]="autocomplete_data"
when autocomplete_data
is the source.
So how can I control or 'mock' the events of real typing?
Upvotes: 1
Views: 157
Reputation: 237
To 'mock' the event triggered by outsource element, I dispatched an event to it:
let input = document.getElementsByClassName('searchText')[0];
input.dispatchEvent(new Event('input'));
Upvotes: 1