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

Component: dropdown - Editable dropdown does not change value to empty string #14546

Closed
ppieczul opened this issue Jan 13, 2024 · 4 comments
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@ppieczul
Copy link

If one of the options is empty string, when selected from the dropdown, the content of the editable box will not change to the empty string. I believe the culprit is this condition:
https://github.com/primefaces/primeng/blame/2585e7c8f6c7f5a37d97e7712f9fb293bd4f6065/src/app/components/dropdown/dropdown.ts#L943

@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 13, 2024
@ppieczul ppieczul changed the title Editable dropdown does not change value to empty string Component: dropdown - Editable dropdown does not change value to empty string Jan 13, 2024
@mertsincan
Copy link
Member

Thanks a lot for your report and hint! We'll check it before the next version is released.

@mertsincan mertsincan 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 Jan 15, 2024
@mertsincan mertsincan added this to the 17.3.3 milestone Jan 15, 2024
@cetincakiroglu cetincakiroglu self-assigned this Jan 17, 2024
@cetincakiroglu cetincakiroglu added LTS-PORTABLE Issue's fix will be ported to supported LTS versions LTS-16-PORTABLE and removed LTS-PORTABLE Issue's fix will be ported to supported LTS versions labels Jan 19, 2024
@jayee
Copy link

jayee commented Jan 24, 2024

This solution breaks the placeholder text.
Try clearing a selected value in your example, https://primeng.org/dropdown#template

@xSebeq
Copy link

xSebeq commented Jan 26, 2024

I noticed the same thing as @jayee

<span *ngIf="(modelValue() === undefined || modelValue === null) && (label() === placeholder || (label() && !placeholder))">{{ label() === 'p-emptylabel' ? '&nbsp;' : placeholder }}</span>

Maybe there should be
(modelValue() === undefined || modelValue() === null)
instead of
(modelValue() === undefined || modelValue === null)

@jakubnavratil
Copy link

Just confirmed, this is a bug - no placeholder visible, missing brackets in code

I noticed the same thing as @jayee

<span *ngIf="(modelValue() === undefined || modelValue === null) && (label() === placeholder || (label() && !placeholder))">{{ label() === 'p-emptylabel' ? '&nbsp;' : placeholder }}</span>

Maybe there should be (modelValue() === undefined || modelValue() === null) instead of (modelValue() === undefined || modelValue === null)

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

6 participants