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

svelte-select Displays Undefined for Numeric Values #662

Open
georgeemr opened this issue Jan 5, 2024 · 1 comment
Open

svelte-select Displays Undefined for Numeric Values #662

georgeemr opened this issue Jan 5, 2024 · 1 comment

Comments

@georgeemr
Copy link

Problem: The svelte-select component is not displaying the selected item correctly when the items prop is an array of objects with numeric values. However, it works as expected with string values. When using numeric values, the selected item shows "undefined" instead of the correct label.

Expected Behavior: Irrespective of the data type of the value field in the items array (string or numeric), the svelte-select component should display the label of the selected item correctly.

Steps to Reproduce:
Use the svelte-select component with an items array having numeric values for the value field.
Two ways to reproduce it:
• When the item is set on the OnMount (for example if i'm loading a model from a API) notice that the component displays "undefined" for the selected item.
• If you search the value, then select it, it shows undefined too. If you don't search, just select it from the list, it works.

Sample Code:
https://svelte.dev/repl/f203e41b174441a1a217216ce01b0099?version=4.2.8

@georgeemr
Copy link
Author

georgeemr commented Jan 6, 2024

I think this pull resolve this problem: #612

But anyone hasn't merged.
Does this project is still active?

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

1 participant