tooltipEvent = "focus" is not working with p-autoComplete

UI Components for Angular
Post Reply
loanmartit
Posts: 3
Joined: 17 Nov 2017, 20:20

18 Nov 2017, 03:13

I'm wondering how can I achieve, I only want to show the tooltip when user focus on text box field of the p-autocomplete.

Please help.

Thanks

loanmartit
Posts: 3
Joined: 17 Nov 2017, 20:20

20 Nov 2017, 20:49

Seem like onFocus/onBlur events of the input, they do not fire these events to the selector dom (p-autoComplete in this case). Hope it will be fixed in the future version.

My workaround:

<p-autoComplete #someVar id="acSimple" [(ngModel)]="country" [suggestions]="filteredCountries" (completeMethod)="filterCountry($event)"
field="name" [size]="30" placeholder="Select Country" [minLength]="1"
pTooltip="Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh. Aenean quam." tooltipEvent="focus"
(onFocus)="reDispatchEvent($event, someVar)"
(onBlur)="reDispatchEvent($event, someVar)">
</p-autoComplete>

reDispatchEvent(event: any, dom: any) {
dom.el.nativeElement.dispatchEvent(new event.constructor(event.type, event));
}

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 10 guests