Choices-js / Choices

A vanilla JS customisable select box/text input plugin ⚡️
https://choices-js.github.io/Choices/
MIT License
6.05k stars 597 forks source link

duplicateItemsAllowed not working #1123

Open alicericci opened 1 year ago

alicericci commented 1 year ago

It's not possible to select the same items twice dispite duplicateItemsAllowed default being true.

  <select multiple>
    <option value="Choice 1">Choice 1</option>
    <option value="Choice 2">Choice 2</option>
    <option value="Find me">Choice 3</option>
    <option value="Choice 4">Choice 4</option>
  </select> 
const element = document.querySelector('select');
const choices = new Choices(element, {
  editItems: true,
  renderSelectedChoices: "always",
});

Expected behavior When clicked, Choice 2 is added to the list even if it's already selected

Screenshot 2023-06-15 at 15 07 08