ProgressNS / nativescript-ui-feedback

This repository is used for customer feedback regarding Telerik UI for NativeScript. The issues system here is used by customers who want to submit their feature requests or vote for existing ones.
Other
115 stars 21 forks source link

RadDataForm angular autocompleteinline bug when using keys and labels. #1440

Open agallo73 opened 4 years ago

agallo73 commented 4 years ago

When using objects with labels and keys as valuesProvider within a raddataform the AutoCompleteInline is unusable. It always fires a PropertyCommit event with key -1 for the autocompleteinline editors and the gui blocks. I also tried bypassing the Committ event in the onPropertyCommit method in order to skip events with values -1 returning false instead of committing. However, in this case, every time the autocomplete sets a new provider concerning an other property (for instance when you select a country you have to recreate the city list in the city editor) , the problem arises again and the same PropertyCommit event with key -1 is fired for the property ( country) triggering the update of the other (city). The result is that the field (country) is never updated with the current value and remains empty and the user suppose that no change has been performed. The problem surely happens on mac ios using emulator. I did not try on android platform. To recreate the problem please look at

https://github.com/ProgressNS/nativescript-ui-samples-angular/tree/master/dataform/app/examples/value-providers/relations

and replace Picker editors with AutoCompleteInline.

Please check how the gui loops for ever and commit events with -1 as key value are fired for both countries and city property.

Then try this:

In the onPropertyCommit method add this lines in order to make the ui work (otherwise it loops for ever) if(property.valueCandidate === -1 && args.propertyName === "country") { console.log("Skipping value for property " + property.name); args.returnValue = false; }

and try select a country, for instance UK. Since the action generates a new valuesProvider to be created for Cities, the country field is not updated because a commit event with key -1 is raised for country even if his value has correctly been selected. Why this? It may be ok that this event is raised for cities but not for country property which has already been selected and should keep its value. When you select the city, instead, the value of the city is kept because no provider is set for other fields. This problem makes it impossible to use the autocomplete in the dataform because the fields are never updated when changing some other provider.

TNS version is 6.3.0