Open ValentinCOC opened 1 week ago
Hi,
Could you please share a stackblitz example so we can identify the issue clearly?
@mehmetcetin01140 I added a stackblitz. To reproduce type 3 then click with the mouse and then i enter 4 and click again. At some point it will break and the latest selected value is not displayed on top of the autocomplete. I also need to use the onBlur event to hide the dropdown. Is the autocomplete intended to work like this?
Describe the bug
The error occurs primary on MS Edge browser (hard to reproduce in Chrome). When it occurs no event from onSelect is emitted.
Code: `<p-autoComplete *ngIf="!isRevision"
newSubtaskAutocomplete
[suggestions]="filterdNewSubtasks" [group]="true" (onFocus)="newSubtaskAutocomplete.handleDropdownClick($event)" [dropdown]="true" panelStyleClass="custom-group-panel top" [panelStyle]="{ 'min-height': '250px' }" (onSelect)="emitAddedStep($event)" (onBlur)="newSubtaskAutocomplete.hide()" (completeMethod)="filterNewSubtasks($event, newSubtaskAutocomplete.value)" [styleClass]="'with-dropdown'" [style]="{ width: '400px' }" placeholder="Schritt hinzufügen">
`
In the function for the onSelect event the input is cleared because the value gets processed.
public emitAddedStep($event): void { const selectedStep = $event.value; this.addedStep.emit(selectedStep.value as LfStep); setTimeout(() => { if (this.newSubtaskAutocomplete.clear) { this.newSubtaskAutocomplete.clear(); } }, 1); }
Maybe I am doing something terribly wrong, then please tell me :)
Environment
Reproducer
Stackblitz example
Angular version
16.2.12
PrimeNG version
16.9.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.17.0
Browser(s)
Edge
Steps to reproduce the behavior
Expected behavior
onSelect-event always emits a value when an item was clicked