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

p-dropdown: setting style="width:100%" doesn't bind to model #14857

Closed
ksmit opened this issue Feb 22, 2024 · 2 comments
Closed

p-dropdown: setting style="width:100%" doesn't bind to model #14857

ksmit opened this issue Feb 22, 2024 · 2 comments
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working

Comments

@ksmit
Copy link

ksmit commented Feb 22, 2024

Describe the bug

p-dropdown doesn't bind to the property specified in ngModel when style="width:100%" is specified.
[ngStyle] is working as intended.

Environment

  • windows
  • angular

Reproducer

https://stackblitz.com/edit/github-ey2joz

Angular version

17.1x

PrimeNG version

17.7.x

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v18.19.0

Browser(s)

No response

Steps to reproduce the behavior

  1. Change value of Dropdown 2

Expected behavior

Value should change from
Selected Value Dropdown 2 : 0

to selected value eg.
Selected Value Dropdown 2 : 1

@ksmit ksmit added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 22, 2024
@mehmetcetin01140 mehmetcetin01140 added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 26, 2024
@mehmetcetin01140 mehmetcetin01140 added this to the 17.Future milestone Feb 26, 2024
@dalenguyen
Copy link
Contributor

dalenguyen commented Mar 12, 2024

It dues to the fact that p-dropdown has its own style Input that receives an object then passes to ngStyle.

@Input() style: { [klass: string]: any } | null | undefined;

...

[ngStyle]="style"

You can try this one.

  <p-dropdown
    [style]="{ display: 'block', width: '100px' }"
    [options]="options"
    [(ngModel)]="selectedOne"
  />

@mehmetcetin01140
Copy link
Contributor

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,

@github-project-automation github-project-automation bot moved this to Done in PrimeNG Dec 16, 2024
@mehmetcetin01140 mehmetcetin01140 removed this from the 19.x milestone Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
Status: Done
Development

No branches or pull requests

3 participants