Roi Sadika
Roi Sadika

Reputation: 237

Angular: NgbTypeahead and onScreen keyboard

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

Answers (1)

Roi Sadika
Roi Sadika

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

Related Questions