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

Multiselect adding the SelectOptionType object and not Value property to the bound:value array #864

Closed
wil-den opened this issue Jun 19, 2023 · 4 comments · Fixed by #892

Comments

@wil-den
Copy link

wil-den commented Jun 19, 2023

Describe the bug

Maybe this is expected behaviour?
I give a list of items to the Multiselect component.
The items in the list are of the shape { name: , value: }
I bind an array to hold the selected items.

What I expected to find in the selectedItems array was the value property from the items contained in the item list and not the complete object itself.

Obviously I can work around this myself but I wanted to know if this is what you expected?

Reproduction

Not sure if this is a bug or not so I have not reproduced this

Flowbite version and System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
    Memory: 3.86 GB / 15.73 GB
  Binaries:
    Node: 18.15.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.5.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (114.0.1823.51)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    flowbite-svelte: ^0.37.5 => 0.37.5
    svelte: ^3.55.1 => 3.58.0
    vite: ^4.2.0 => 4.2.1
@shinokada
Copy link
Collaborator

@vasucp1207 Can you reply to this?

@vasucp1207
Copy link
Contributor

Thanks for clarifying fixes this in #870

@itaibaruch
Copy link

Hi, the fix did the job.
But we missing the case that value property has a list defined, if so the component should pre-select them.

Here is a StackBlitz: https://stackblitz.com/edit/sveltejs-kit-template-default-l9zfbe?file=src%2Froutes%2F%2Bpage.svelte

@vasucp1207
Copy link
Contributor

Hi, the fix did the job. But we missing the case that value property has a list defined, if so the component should pre-select them.

Here is a StackBlitz: https://stackblitz.com/edit/sveltejs-kit-template-default-l9zfbe?file=src%2Froutes%2F%2Bpage.svelte

Fixed in #892

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

Successfully merging a pull request may close this issue.

4 participants