Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blur event not recognized by p-autocomplete #1387

Closed
avallabh88 opened this issue Nov 21, 2016 · 1 comment
Closed

Blur event not recognized by p-autocomplete #1387

avallabh88 opened this issue Nov 21, 2016 · 1 comment

Comments

@avallabh88
Copy link

I'm submitting a (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior
p-autocomplete has some default event listeneres like onSelect, change, click, blur, focus etc. I have a method to be called when the blur event is fired. The blur event does not call the method inside the component.

Expected behavior
The blur event should be triggered on p-autocomplete and call the method.

Minimal reproduction of the problem with instructions:

The following is the code:

html:

<p-autoComplete [(ngModel)]="empText" inputStyleClass="form-control" [minLength]="1" [suggestions]="empData"
field="text" (completeMethod)="getEmployeeData($event)"
(blur)="onBlur($event.target.value)" (change)="onEmpDataChanged($event.target.value)">

I have the following method in my component.ts:

// Set touched on blur
onBlur(e: any) { //this method is not called
    alert("control is blurred");
    this.onTouchedCallback();
}

What is the motivation / use case for changing the behavior?
In forms where there are validations and we want to display error messages for required fields, in that situation when the user tabs out of the field without entering any values then the required message should be shown. Now that the blur event is not fired the actions are not recognized and the required message is not shown.

Please tell us about your environment:
Operating system, IDE: Windows IDE, VS Code

Angular version: 2.0.

PrimeNG version: 1.0.0-rc.5

Browser: All (Chrome, Firefox and IE)

Language: TypeScript, ES6

Node (for AoT issues): node --version = v.5.2.0

@cagataycivici
Copy link
Member

Fixed via;

#2256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants