Vue-select: Do not show the selected items in the dropdown

Created on 5 Jun 2020  路  1Comment  路  Source: sagalbot/vue-select

To Reproduce
Steps to reproduce the behavior:

  1. Add multiple tag
  2. Select one item from the dropdown
  3. Toggle dropdown in order to see if the selected item is in the list

Expected behavior
Most of the select components including the most popular one in React ecosystem (https://react-select.com) do not show the selected items in the dropdown in order to avoid inconsistencies and let the user know which items are not selected. Currently, vue-select doesn't do anything when we click an item which is already selected and we got UX bug reports from our users regarding this specific behavior.

Screenshots
Screen Recording 2020-06-05 at 04 28 AM

This is how react-select behaves:
Screen Recording 2020-06-05 at 04 28 AM (1)

Most helpful comment

To counter this problem i used the selectable prop and add the already selected items so that it disables them,
Check this code :

<v-select
                  v-model="selectedItems"
                  multiple
                  :reduce="selected => selected"
                  :options="['aaa', 'bbb', 'ccc', 'ddd']"
                  :selectable="selected => !selectedItems.includes(selected)"
 />

>All comments

To counter this problem i used the selectable prop and add the already selected items so that it disables them,
Check this code :

<v-select
                  v-model="selectedItems"
                  multiple
                  :reduce="selected => selected"
                  :options="['aaa', 'bbb', 'ccc', 'ddd']"
                  :selectable="selected => !selectedItems.includes(selected)"
 />
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ducdev picture ducdev  路  3Comments

manjunath-coachthem picture manjunath-coachthem  路  3Comments

fabianmieller picture fabianmieller  路  3Comments

davidalvarezr picture davidalvarezr  路  3Comments

mattWalters0 picture mattWalters0  路  3Comments