-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
AutoComplete input does not reflect model changes #2882
Comments
I've installed 4.0.2 but this bug is still there. I'm changing a variable that has a two way binding to a model but the change doesn't reflect the text box value. |
The issue occurs after selecting a value from the dropdown and trying to change it on OnSelect event handler |
@ohadinho I can't replicate the issue. The value is reflected after button clear using both single and multiple features. |
Steps to replicate:
1. Press the arrow to open the dropdown
2. Choose a value
3. Debug "OnSelect" method and change the ngModel variable value.
Expected Result: Value is the same as you defined after the change on
OnSelect method.
Actual Result:
The change in variable binded to ngModel didn't affect the input text.
…On Jun 10, 2017 06:47, "Sudheer Jonna" ***@***.***> wrote:
@ohadinho <https://github.com/ohadinho> I can't replicate the issue. The
value is reflected after button clear using both single and multiple
features.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2882 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEqculVUF5yHTKUZA8qszHrMSXbpYi1gks5sChHGgaJpZM4NmX7r>
.
|
primeNg version: 4.1.0 <p-autoComplete placeholder="Start typing name to see suggestions" formControlName="customerRequest" [suggestions]="customerResults" (completeMethod)="searchCustomer('customer_name', $event.query)" minLength="3" field="accountName" (onSelect)="setCustomerRequest($event)"> Start type 'abc' Result: customerRequest (model) set to null but the field is not cleared/reset. Expected: Field should be reset to null. If I select some value from the option and clear, field is reset to null. Please address this issue. |
Issue exists in 4.1.2 as well |
primeNg version: 4.1.3 I noticed that p-autoComplete expects the model to be type object in the template. If the value is a string, the resolveFieldData method returns undefined, which sets the input value to an empty string. Changing this fixes it for me:
To:
Alternatively adding this at the top of the resolveFieldData method works as well (and is probably the safer way to handle it):
|
The problem still exists in version 4.1.3, why did you close the issue? |
@iblank alternate method works for me....please make this change |
When i cleared the suggestions input field. It worked for my case. But issue still exists. |
Still broken, wanting to clear the control when a selection is made... I null out the bound model and the suggestions list onSelect within a setTimeout even... when you click elsewhere on the screen, it does clear out |
Status of this fix? |
Found a possiblle workaround. |
Another approach : Create a template variable suppose in autoComplete tag #station onStationSelection(station){ this.stationDrpdown['inputFieldValue']=station.name; |
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
http://plnkr.co/edit/r7DnQw?p=info
Current behavior
Text does not clear from autocomplete box
Expected behavior
Text should clear from autocomplete box
Please tell us about your environment:
OS : WIndows 7
Angular version: 4.0.3
PrimeNG version: 4.0.1
Browser: Chrome 58.0.3029.110 (64-bit),
The text was updated successfully, but these errors were encountered: