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 - value that is not in the options is not displayed in the edit box after restart #14549

Closed
ppieczul opened this issue Jan 13, 2024 · 6 comments
Assignees

Comments

@ppieczul
Copy link

Describe the bug

The value entered in the editable field, if it is not among the selectable options, it is not displayed in the edit box when component is reinitialised. Also, if the dropdown is not editable, and the value is not among the options, it is not displayed. I am not sure if it should display that value, I think it should at least in case of editable dropdown. It may be a matter of initialising the editable box value to the current value.

Environment

Electron app

Reproducer

No response

Angular version

17.0.8

PrimeNG version

17.3.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

21.5.0

Browser(s)

Chrone

Steps to reproduce the behavior

Create a dialog with a dropdown with some options A, B, C and make it editable
Enter something D that is not A, B, C in the dropdown edit box, store the value and close dialog
Open the dialog - the D is displayed in the edit box
Reload the application and open the dialog - the edit box is empty, but value D is set in the runtime properly

Expected behavior

Value not in the options list should be displayed in the edit box and allow to be edited

@ppieczul ppieczul 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 Component: Dropdown Component: Dropdown - value that is not in the options is not displayed in the edit box after restart Jan 13, 2024
@mertsincan
Copy link
Member

Hi,

Unfortunately, I couldn't replicate it. Could you please attach a stackblitz link for us to replicate? Thanks a lot!

@mertsincan mertsincan added Resolution: Cannot Replicate Issue could not be replicated by Core Team 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.4.0 milestone Jan 15, 2024
Copy link

We're unable to replicate your issue, if you are able to create a reproducer by using PrimeNG Issue Template or add details please edit this issue. This issue will be closed if no activities in 20 days.

@mertsincan mertsincan added the Resolution: Needs More Information More information about the issue is needed to find a correct solution label Jan 15, 2024
@ppieczul
Copy link
Author

I am doing this sharing for the first time, sorry if something did not work:
https://github-fdtcqh.stackblitz.io

There are three dropdowns. First two are initialised to a value existing in options and show the value ok.
Third is initialised to a value not in options and box is empty.
This would make sense, if not the fact that when you edit the value in the dropdown editable box, it puts the entered value into the linked ngModel variable. So why not restore it exactly the same way into the dropdown editable box.

@cetincakiroglu cetincakiroglu self-assigned this Jan 23, 2024
@cetincakiroglu
Copy link
Contributor

Hi,

Your example does not start you can fork this example to create a new one https://stackblitz.com/edit/hqi4ek?file=package.json

@cetincakiroglu cetincakiroglu modified the milestones: 17.4.0, 17.5.0 Jan 24, 2024
@cetincakiroglu cetincakiroglu added the Status: Discussion Issue or pull request needs to be discussed by Core Team label Jan 25, 2024
@ppieczul
Copy link
Author

Here it is: https://stackblitz.com/edit/hqi4ek-aqswqg

@cetincakiroglu
Copy link
Contributor

Hi,

Thanks for the example, it seems that the issue has been fixed in v17.4.0 https://stackblitz.com/edit/hqi4ek-yzaslk?file=src%2Fapp%2Fdemo%2Fdropdown-basic-demo.ts,src%2Fapp%2Fdemo%2Fdropdown-basic-demo.html,package.json

Closing the issue since it doesn't exist in v17.4.0, thanks a lot for reporting the issue!

@cetincakiroglu cetincakiroglu removed this from the 17.5.0 milestone Feb 1, 2024
@cetincakiroglu cetincakiroglu removed Status: Discussion Issue or pull request needs to be discussed by Core Team Resolution: Cannot Replicate Issue could not be replicated by Core Team Resolution: Needs More Information More information about the issue is needed to find a correct solution labels Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants