question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] VSelect list item custom key

See original GitHub issue

Problem to solve

In VSelect and derived components using VSelectList, menu items are generated with an id depending on the current _uid and the index of the item. However, with VAutocomplete, item array can dynamically change, and components will be recreated every time. I currently have an item that can load external resource depending on the input, so recreating components is costly. I’d like to evaluate the solution of providing a key for the item, so that Vue internals reuse components in a smarter way.

Proposed solution

If I understand correctly, VSelectList must be updated to use a user defined key.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
KaelWDcommented, Oct 14, 2020

if you plan to implement a new prop in the future

It makes sense to me to just use item-value as the key if it isn’t an object.

0reactions
Glandoscommented, Oct 14, 2020

OK, now I know why Vuetify is popular. When developers take the time to understand and answer precisely with good solution, it’s worthy.

So the workaround is indeed (for external readers) to use a v-list-item otherwise VSelectList will create one without key.

@KaelWD I let this opened if you plan to implement a new prop in the future, but for me, it can be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Select All Feature in v-select not save all the items
I am trying to add a select all button to the v-select component of vuetify. I am able to select all the options...
Read more >
v-autocomplete API - Vuetify
name type default #append‑icon string '$dropdown' #append‑outer‑icon string undefined #attach any false
Read more >
Build A Custom Vue Select Component - YouTube
Lets build a pretty looking custom vue select component that replaces the traditional default element element. Lets build it with Vue 3, ...
Read more >
Make Dropdown with Search box with vue-select - Vue.js
HTML <select > element doesn't provide search feature. In VueJS you can use vue-select component to add a customizable and responsive select ...
Read more >
Vue-Multiselect | Vue Select Library
The basic single select / dropdown doesn't require much configuration. ... custom-label accepts a function with the option object as the first param....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found