vue-select icon indicating copy to clipboard operation
vue-select copied to clipboard

Taggable: Selecting custom item second time after clearing input via "x" button ignores set label.

Open kamerat opened this issue 5 years ago • 1 comments

Describe the bug If you select a custom taggable item, remove it (via x), then add it again, the select displays the items value, not label as it does the first time.

To Reproduce Steps to reproduce the behavior:

  1. Type/"search" for something that is not in the select & click/select it: eg "Karen Doe"
  2. Click the "x" to clear the select
  3. Again, type something that does not exist and click/select it: "Karen Doe"
  4. The ID (-100) will be shown as selected instead of the label (The thing you typed / "Karen Doe")

codesandbox reproduced project

Props & Event listeners:

v-model="x"
taggable
label="fullName"
name="responsible"
placeholder="Select"
:options="employees"
:reduce="employee => employee.id"
:create-option="fullName => ({ fullName, id: -100 })"
:disabled="false"
@option:created="responsible_custom_name = $event.fullName"

Expected behavior Select should always display label. In .3 above, the select should have displayed "Karen Doe", not "-100"(it's value)

Screenshots gif

Desktop (please complete the following information):

  • OS: iOS
  • Browser chrome
  • Version 3.10.8

kamerat avatar Aug 20 '20 14:08 kamerat

I also encountered this problem. Has anyone been able to solve it?

acanthis avatar Nov 13 '24 16:11 acanthis