Skip to content
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 disabled property doesn't work with reactive forms only #15879

Closed
bvx5009 opened this issue Jun 21, 2024 · 3 comments
Closed
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@bvx5009
Copy link

bvx5009 commented Jun 21, 2024

Describe the bug

Adding a disabled property on the p-dropdown component does not disable it when using reactive forms but works with template forms.

reactive form:
https://stackblitz.com/edit/zjnhge-6dbvzu

template form:
https://stackblitz.com/edit/7ajim1-dw9brl

Environment

stackblitz

Reproducer

No response

Angular version

18.0.1

PrimeNG version

17.18.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v18.20.3

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

disabled property should disable the dropdown

@bvx5009 bvx5009 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 21, 2024
@dl3g0
Copy link

dl3g0 commented Jun 24, 2024

hi @bvx5009 , To disable the input of a reactive form, you should do it this way
image
,Then you need to remove [disabled]='true' from your HTML; this is only useful when using [(ngModel)]

@bvx5009
Copy link
Author

bvx5009 commented Jun 24, 2024

@dl3g0 thanks for the reply!

yeah, that is what i ended up doing at the end. Seems like we should update the documentation or something. If i have a conditional variable to disable my form i have to do it in the ts rather than the property

@mertsincan
Copy link
Member

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!
Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

3 participants