-
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 Option: Does not display selected value when editable=true #14216
Comments
Hi, Could you please try with it PrimeNG 17.0.0-beta.1 I couldn't replicate with the latest. Probably the issue is fixed in 16.9.2 |
We're unable to replicate your issue, if you are able to create a reproducer by using PrimeNG Issue Template or add details please edit this issue. This issue will be closed if no activities in 20 days. |
In the provided stackblitz, it uses the v17 version of primeng, and the problem is still there. |
Enregistrement.de.l.ecran.2023-11-28.a.10.06.56.movAt the end of the video, you will see that a I refresh the page, and the New York entry is suposed to be selected by default, as you can see in the form control. But as you can see in the video, in the dropdown, the entry is selected, but not displayed when the dropdown is closed. |
Hi @cetincakiroglu The options we give to this component have to following structure: export interface DropdownOption<T> {
label: string;
value: T;
disabled?: boolean;
tooltip?: string;
dataKey?: string;
} So we MUST use optionValue, in order to not have a FormControl with this object in it, instead of only the "value" field. |
Cannot even use the selectedItem template to bypass the problem. Everything seems linked to editable=true. I updated the stackblitz to illustrate the problem |
I'm facing the same issue. I can not see any workaround currently then to set editable=false |
Yep, we also cannot find any workaround ... It's an internal software, so we told everyone there was this problem, because, we obsolutly need the editable feature, in order to provide a custom volue, not listed in the dropdown options ... |
For those using an option objet with that looks like this: export interface DropdownOption<T> {
label: string;
value: T;
} You can omit optionValue and optionLabel property, and it will solve the problème . |
Any news guys ? @cetincakiroglu Can you at least change the ticket status ? |
any updates on this one? I'm facing the same issue. |
Nope, nothing, not even the status change, since the example I provided reproduce the exact problem. @jules-js |
Try with v17.10.0, it seems working now. |
I have also encountered this bug also occurs with filter option instead of editable PrimeNg: 17.18.3 |
Same problem for me with filter option instead of editable!!! PrimeNg: 17.18.3 |
I'm having the same problem using PrimeNg: 17.18.11 and NOT using the filter or editable options but I am using [(ngModel)] (template driven). In another application, I'm using formControlName (reactive) instead. Not sure if that's the difference but maybe? |
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? Best Regards, |
Describe the bug
When using Dropdown options component, with editable=true, the selected option is not displayed and even, if an initial value is provided, it also does not display it.
Environment
"@angular/cdk": "^17.0.1",
"@angular/common": "^17.0.3",
"@angular/compiler": "^17.0.3",
"@angular/core": "^17.0.3",
"@angular/fire": "^16.0.0",
"@angular/forms": "^17.0.3",
"primeng": "^16.9.1",
Reproducer
https://stackblitz.com/edit/j4pc5m?file=src%2Fapp%2Fdemo%2Fdropdown-reactive-forms-demo.html,src%2Fapp%2Fdemo%2Fdropdown-reactive-forms-demo.ts
Angular version
17.0.3
PrimeNG version
16.9.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
21.2.0
Browser(s)
No response
Steps to reproduce the behavior
Use DropdownOption component, set the param editable to true.
Expected behavior
No response
The text was updated successfully, but these errors were encountered: