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: Placeholder is not displayed when using a combination of reactive forms and selectedItem template #14801

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

Comments

@dorthrithil
Copy link
Contributor

Describe the bug

Follow up on #14695

When using a dropdown within a reactive form and while using the template for selectedItem, the placeholder is not shown.

Screenshot 2024-02-14 at 08 37 56

Environment

Chrome on Mac OS

Reproducer

https://stackblitz.com/edit/github-lobmlu-qzceky?file=src%2Fapp%2Fapp.component.html

Angular version

17.1.3

PrimeNG version

17.6.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.9.0

Browser(s)

No response

Steps to reproduce the behavior

Check the Stackblitz

Expected behavior

Placeholders always show when no option is selected.

@dorthrithil dorthrithil 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 14, 2024
@rosenthalj
Copy link
Contributor

The follow change to line 29 of your reproducer fixes the issue:

Change:
name: ['']
To:
name: [null]

Primefaces_-Primeng_Issue_Template__forked_-_StackBlitz

@cetincakiroglu cetincakiroglu added this to the 17.8.0 milestone Feb 14, 2024
@dorthrithil
Copy link
Contributor Author

Thanks @rosenthalj, this solves it for me. But I still think there is a little issue here as in the case "Reactive forms an no seletedItem template" the placeholder is shown, even though it uses the same control. I would expect the same placeholder behaviour for the case with template and without.

@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 16, 2024
@cetincakiroglu cetincakiroglu self-assigned this Feb 22, 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
None yet
Development

No branches or pull requests

4 participants