-
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
Major bug p-dropdown in latest LTS version! #15026
Comments
I have the same error, looks like a regression |
Considering the size of that diff, the ammount of issues I experienced with p-dropdown since, and the ammount of dropdown issues reported here, I am fairly sure that this is not the only regression. The mentioned commit also introduces the use of signals, including the |
I agree with @basvandenberg Please can you provide a solution for this ASAP |
Hi @guido8686, Could you please share a stackblitz example so we can identify the issue? |
I think your template has some issue. It should be something like this: You should check if
If you don't want to use ngIf, you can use optional:
You can copy and paste to your stackblitz. |
The selected option is provided as context in the However, didn't @guido8686 mention that this used to work before 16.7.0? It would also make sense that the selected option is provided as context variable, and that this is context variable is never |
Indeed like @basvandenberg mentioned, the *ngIf should not be necessary, and this was not necessary before 16.7.0 With other words, all previous projects using templates in dropdowns will break when upgrading because the *ngIf was not needed before. Adding the *ngIf on the template could be a possible workaround. A possible solution could be to check if the value is present in the template component itself. |
Hi, Thanks a lot for reporting the example, this works with the latest version (v17.11.0), we'll port the fixes in the upcoming LTS release next week. |
Hi @guido8686, lts version 16.9.7 is released now. You can download and use it. |
Describe the bug
We recently purchased the LTS license for v16.x. But unfortunately we cannot use it in our project because there seems to be an issue with some components. The p-dropdown for example is causing errors, while in previous version of PrimeNG it was working as expected.
It looks like things broke since version 16.7.0.
See:
f52340b#diff-6c150dd52985058b500004b45dc02ee3d7bf072068491df756a829825f17dc4c
Environment
Windows and Unix
Reproducer
No response
Angular version
16.2.12
PrimeNG version
16.9.6-lts
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
16.20.2
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
There seems to be an issue with p-dropdown in combination with pTemplate.
It is throwing errors saying: cannot read properties of undefined reading name.
The text was updated successfully, but these errors were encountered: