-
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 set options and value at the same time #11559
Comments
PrimeNG 13.3.3 has no the issue |
I agree, still having the same behavior. The easy way to replicate it is to bind options to async pipe. I agree that 13.3.3 has no such issue and from looking into code it looks like options binding logic was changed. Thanks, |
I have the same problem. Also this model trigger makes the dropdown dirty. It's triggering validation and set box to red because I use ng-dirty as state of user touch |
Hi @IgorMenshikov , Couldn't replicate the issue, could you please provide a StackBlitz example? |
Hi @cetincakiroglu ! I am not sure how to quickly create PrimeNG example on StackBlitz. Is there any template for that? |
Hi @cetincakiroglu, you can find an example of this issue here: https://stackblitz.com/edit/primeng-issue-11559?file=src/app/app.component.ts You can see how, just by receiving the options asynchronously, the drop down emits a I've highlighted the 'ng-dirty' state of the example with an exaggerated overflow color, but you can see that the default theme validation (.ng-invalid.ng-dirty) kicks in and sets the border-color to red |
Same issue with 13.4.1. This is only happening to DDLs populated via an async call to the back end. The DDL's dirty flag looks fine after the call but it gets set to dirty at some point after. We have code on canDeactive to fire a "Save Changes" dialog if the form is dirty and the DDL's dirty flag is set to true by then, preventing the user from leaving the screen. 13.3.3 seems to be ok (after clearing build cache) |
Can confirm that this issue is present in 13.3.3 and 13.4.1 |
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, |
[x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Recently the change has been made:
d2c3db6
It does not allow to set options and value at once:
Current behavior
Does not set a value if set options at the same callback function.
Expected behavior
DropDown value has to be set together with options
HTML code:
Initial state code:
Change code:
I think the issue is caused by:
The text was updated successfully, but these errors were encountered: