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

Weird Select behavior #121

Closed
leonardodipace opened this issue Oct 4, 2023 · 1 comment
Closed

Weird Select behavior #121

leonardodipace opened this issue Oct 4, 2023 · 1 comment

Comments

@leonardodipace
Copy link

Description

The Select component acts weardly when using the multiple property. If I try to save the selected value to a variable, the variable doesn't seem to react to the changes.

Steps to reproduce

Use the following code snippet:

<script lang="ts">
  import { Select } from "bits-ui";

  let selected = [];

  $: console.log(selected);
</script>

<Select.Root multiple bind:selected>
  <Select.Trigger>
    <Select.Label>Label</Select.Label>
    <Select.Value placeholder="Choose..." />
  </Select.Trigger>
  <Select.Content>
    <Select.Group>
      <Select.Item value="apple">Apple</Select.Item>
      <Select.Item value="peach">Peach</Select.Item>
      <Select.Item value="banana">Banana</Select.Item>
      <Select.Item value="blueberry">Blueberry</Select.Item>
    </Select.Group>
  </Select.Content>
</Select.Root>

When multiple values are selected, the selected variable doesn't update.

Expected behavior

The selected variable should update each time a value is selected, populating an array.

Actual behavior

The selected variable doesn't update at all.

@huntabyte
Copy link
Owner

Closed by #184

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

2 participants