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
tooltipEvent = "focus" is not working with p-autoComplete
-
- Posts: 3
- Joined: 17 Nov 2017, 20:20
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));
}
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));
}
-
- Information
-
Who is online
Users browsing this forum: Google [Bot] and 10 guests