Code: Select all
<td pEditableColumn>
<p-cellEditor>
<ng-template pTemplate="input">
<p-autoComplete #pathAutoComplete [(ngModel)]="asHost(row).path"
[suggestions]="fileResults"
(completeMethod)="fileSearch($event)"
(onSelect)="valueSelected($event, pathAutoComplete)"
(onKeyUp)="onKeyUp($event)"
(onBlur)="onBlur($event)"
></p-autoComplete>
</ng-template>
<ng-template pTemplate="output">
{{asHost(row).path}}
</ng-template>
</p-cellEditor>
</td>
Is there a way to prevent the selection from causing p-autoComplete to loose focus?
BTW: when a suggestion is selected, the onBlur() is never called, nor even the onKeyUp (for Enter), and the onSelect doesn't have an event, just the selected value, so there's no way to do an event.preventDefault().