-
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
Dropdown: p-dropdown in custom component ignors first ngModel value #14609
Comments
yes same for me |
MultiSelect component has the same bug |
I believe we are experiencing the same timing issue with |
We are having the same problem. When the dropdown is wrapped inside a custom form input component (with ControlValueAccessor). When the options are dynamically loaded (from BE call with async for example), the model gets auto updated to a null/empty (because the options are not yet available). Setting Version 17.3.3 still works ok. |
We're encountering the same issue with the p-dropdown component inside a custom input when data is loaded dynamically, |
I updated this reproduction to show the issue remains in today's release of 17.6.0. |
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 open a new issue so we can include it in our roadmap? Thanks a lot for your understanding! |
Describe the bug
hi,
i've got a timing problem when wrapping your p-dropdown in a custom component.
Scenario:
Problem:
--> not the custom component itself, but the internal p-dropdown overwrites the ngModel-value
not sure, but could be that the effect() delays the internal behavior?
I upgraded from an older version of primeng prior to onPush and Signals, there this implementation worked without problems. The behavior can be "fixed" from within the wrapped component by delaying the first value transmitted via ngModel with setTimeout(), which feels odd.
Question is: is this a bug, an accepted problem or bad implementation on my side :-)
I made a stackblitz (link) example to show the problem:
select an item in the list
clear value - destroy editor & dropdowns
useFix-button:
Thanks & best regards!
Environment
Stackblitz, latest angular, latest primeng
Reproducer
https://stackblitz.com/edit/github-4z4rkv-shubex?file=src%2Fapp%2Fcustom-dropdown%2Fcustom-dropdown.component.ts
Angular version
17.1.0
PrimeNG version
17.3.3
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.18.0
Browser(s)
Chrome latest
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: