Skip to content

Bug: Only one selected item is shown in the input while using vscode-multi-select combobox property #510

@anitbehera

Description

@anitbehera

Image

  • Using combobox property in vscode-multi-select
  • 2 options are pre-selected (Afghanistan, Albania)
  • In the searchbox, only the one option is being displayed.
  • Even user de-selects all the options, still the value doesn't disappear.

Expected Behaviour

  • None of the selected option should be displayed in the search input OR all the selected options should be displayed

Using vscode-elements - v2.3.0
Sample Code (React + vite) -

import "@vscode-elements/elements/dist/vscode-multi-select";
import "@vscode-elements/elements/dist/vscode-option";

function App() {
  const countries = [
    { name: "Afghanistan", selected: true },
    { name: "Albania", selected: true },
    { name: "Algeria", selected: false },
  ];
  return (
    <>
      <p> Sample vscode-elem</p>
      <vscode-multi-select id="combobox-example" combobox>
        {countries.map((country) => (
          <vscode-option key={country.name} selected={country.selected}>
            {country.name}
          </vscode-option>
        ))}
      </vscode-multi-select>
    </>
  );
}
export default App;

Also, could you please let me know if there's a way to identify whether an option is selected or deselected, and capture its value accordingly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions