manish-nepal / vue3-select-option-searchable

Vue 3 select option to select an object from a list or an array
MIT License
6 stars 1 forks source link

It appears selectedItem.name should selectedItem[selectedItem.name] #2

Closed dylansproule closed 1 year ago

dylansproule commented 1 year ago

It appears selectedItem.name should selectedItem[selectOptionProps.displayName]

Currently only the list item is updated.

Best, Dylan

manish-nepal commented 1 year ago

Hello Dylan, selectedItem.name works fine, i've shown this selectedItem.name example just to show how the package is used. I double checked it now too. Can you please try again and let me know if the problem still persist's.

dylansproule commented 1 year ago

Thanks for getting back to me, sorry I was referring to the Vue component:

https://github.com/manish-nepal/vue3-select-option-searchable/blob/main/src/components/SelectOption.vue

Line 8: v-model="selectedItem.name" @input="handleSearch" @click="handleInput" @keydown.enter="handleEnter"

and Line 18: <div class="clear-icon" v-if="selectedItem.name" @click="clearSearch">

manish-nepal commented 1 year ago

Thanks for getting back to me, sorry I was referring to the Vue component:

https://github.com/manish-nepal/vue3-select-option-searchable/blob/main/src/components/SelectOption.vue

Line 8: v-model="selectedItem.name" @input="handleSearch" @click="handleInput" @keydown.enter="handleEnter"

and Line 18: <div class="clear-icon" v-if="selectedItem.name" @click="clearSearch">

Thanks Dylan for pointing out this, I've fixed the issue, Please do update the package

dylansproule commented 1 year ago

Confirmed the updates work as intended, thanks again