-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option not selectable can still be selected via search & enter key #1419
Labels
Comments
@schen-10x can confirm this bug, it only reproducible with the last item in the list for me. Thanks a lot for the suggested fix! |
I'm having the same problem, any idea how to solve it? |
For now I check each option when it's selected to see if it can be
selected, for example:
<v-select :options=*"getOptions"* id=*"source"* :class=*"'col-6'"*
v-model=*"inventory.source"* append-to-body
placeholder=*"Select a Source"*
:selectable=*"(option) => isSourceSelectable(option)"*
@option:selected=*"sourceSelected"*
<template #search=*"{attributes, events}"*>
<input
class=*"vs__search"*
v-bind=*"attributes"*
v-on=*"events"*
:required=*"!inventory.source"*
/>
</template>
</v-select>
in the component's methods:
*sourceSelected*(option) {
//need to do this until vue-select fix its issue #1419
*if* (!*this*.isSourceSelectable(option)) *this*.inventory.source
= *null*;
},
*isSourceSelectable(option)*(option) {
//console.log("option is->", option);
//todo return true or false
},
Hope this helps.
Shao
…On Mon, Sep 13, 2021 at 5:28 PM André Vitor Cuba de Miranda < ***@***.***> wrote:
I'm having the same problem, any idea how to solve it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1419 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATX4EWNBRCQPTVNOHGQKUY3UBZUIRANCNFSM44C7KEYA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
🎉 This issue has been resolved in version 3.18.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
An option that is not selectable can still be selected via search and press the enter key.
Additional context
Upon debugging the typeAheadPonter.js, the typeAheadPointer is first initialized to -1, but after that, it's always set to 0, never reset back to -1. And thus in the typeAheadSelect(), the typeAheadOption will be the the matching filtered option, even if it's not selectable.
Suggest changing line 56: if (typeAheadOption) ---> if (typeAheadOption && this.selectable(typeAheadOption))
The text was updated successfully, but these errors were encountered: