-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Dropdown will not close when put inside label [Bug] #627
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
Comments
Maybe I'm having the same issue, with Vue-Select 2.5.0 my multiple selects refuse to close after opening. You can get them to close by selecting a value, but not by clicking anywhere else on the page or by clicking the caret to close it. Very odd. With 2.4 everything works fine. Tried to debug it and create a minimal reproduction case but didn't succeed yet. |
@sagalbot This is what I get. Also note that the values in the dropdown list are not selected, even though the labels are present in the input. I get no errors or warnings in the console. In fact, I only now noticed that Austria is selected twice! That shouldn't be possible... |
Yikes @ThomHurks, quite a few issues there.. I'll check the diffs between 2.4 and 2.5 today and see if I can dig up anything that might be related to this. Is there any way you could provide a contrived example (markup, options array)? |
@sagalbot I tried if I could solve the duplication problem by setting the "index" property to "id" which is a unique number in my option objects, but then the result is that when I open a previously-saved form, the values that are already present are objects in the "value" array and extra values that I add are added as just the numbers. So then I have mixed objects and numbers in the value array, which is probably not nice. When not using the "index" property, I think the duplicates are because it's using object equality or something else goes wrong during option comparison, and my options and value arrays are of course different, so the objects are not equal even though the contents are the same and so it thinks the option is not already added. I tried creating a repro case yesterday but failed, I will try some more. |
@sagalbot The issue with the duplicate options and some of the selected options not being grey in the dropdown list is already something I can duplicate with this codepen: https://codepen.io/anon/pen/jvLxXv The weird opening/closing issue I cannot repro yet, will work on that later. |
Thanks for the help @ThomHurks, appreciate it. I was able to reproduce tonight as well: Must be an issue with |
Great! 👍 |
I have narrowed the "not opening/closing" issue some more, it only happens to me with controls that have some initially loaded values. If the controls are empty when loading them then everything is fine. While debugging I can see that when I click it does enter Edit: |
@sagalbot @ThomHurks my issue was only when clicking an option, clicking outside closed it fine. This was my reproduction code sorry I didn't keep up with this thread <label>
Labeled
<v-select :options="fuseSearchOptions" label="title" v-model="someValue">
<template slot="option" slot-scope="option">
<strong>{{ option.title }}</strong><br>
<em>{{ `${option.author.firstName} ${option.author.lastName}` }}</em>
</template>
</v-select>
</label>
</div> someValue: [] |
Also worth noting that my issue is present in both master and 2.4.0 |
@ThomHurks thanks for digging! If I recall correctly, @beattyml1 thanks for posting! |
bug still presists. |
For what it's worth, I can reproduce this in 3.4.0. |
https://codepen.io/sagalbot/pen/wvarNjP?editors=1010 @greggilbert can you reproduce? ☝️ seems to work |
I'm also getting this issue in |
Looks like if you do
|
I am getting this issue also on 3.10.3...
I have tried @CHEWX suggestion, however I still cannot get it to work: |
This issue may be related to #1282 |
When a dropdown is put inside of label element the dropdown will close for fraction of a second and then immediately reopen.
I have reproduced in the dev.html plan and plan to work on a fix sometime over the next few weeks and issue a pull request. Feel free to just assign the issue to me.
Long pressing will close it since it will retrigger blur onmouseup in an the element below the dropdown
The text was updated successfully, but these errors were encountered: