Open rafa-suagu opened 4 years ago
Hi,
So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap? Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!
Best Regards,
@mertsincan I can't reopen this issue and we're continuing without trackBy on "selectButton". I think this situation it's happening on more components.
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports) If you need a plunkr showing the big amount of error caused by the trackBy absence I can do it.
Current behavior The selectors are repainting a lot of times when the value is an object, using the dataKey and optionLabel property. Angular can't check the equality properly and repaint the list completely.
This behaviour cause a very bad performance and also raise another errors for example no call the onClick or onChange function or not update the option selected.
Also you are not be able to add a pipe like slice on the input.
Expected behavior Add a trackBy function by default and input to customise it resolves all the errors.
Repainting behaviour: Single mode: Only two elements should be repainted on every selection. Multiple mode: Only one element should be repainted on every selection.
Minimal reproduction of the problem with instructions You can see the error using the dataKey and optionLabel when value is an object, in conjunction with slice pipe to show only 3 elements of options array.
What is the motivation / use case for changing the behavior? To have a good performance, follow the Angular recommendations and have a component that works properly on all the cases.
Please tell us about your environment: MAC OS X Mojave 10.14.6 WebStorm 2019.3 Yarn 1.19.1
Angular version: 8.X
PrimeNG version: 8.X
Browser: all
Language: all