Open siddhartharora002 opened 1 year ago
So I don't know if this is meant to be used with async, but I am using it with the hideOnSelected
prop, which makes the selected options disappear from the list.
I was checking the source code and found this:
<li v-show="showNoOptions && ((options.length === 0 || (hasOptionGroup === true && filteredOptions.length === 0)) && !search && !loading)">
<span class="multiselect__option">
<slot name="noOptions">List is empty.</slot>
</span>
</li>
Findings:
options.length
is not 0 as I can see in my vue-devtoolsoptions group
also herethe condition on the list item results to false
, and thus it's showing display:none
.
Should it not be filteredOptions.length === 0
instead of options.length === 0
?
@akki-jat @shentao Could you please assign me this issue. I have resolved it and created a PR for the same. #1699 . Thanks.
I thought the issue was with my code but I tried it on codesandbox and the issue is still there on vue 2 The
noOptions
slot works just fine, as I can see the value in the DOM but there is adisplay: none
property on the list item that doesn't let it show.Reproduction Link
https://codesandbox.io/s/vue-2-playground-forked-utp9zo
Steps to reproduce
Expected behaviour
It should show![Screenshot 2022-12-15 at 12 35 10 PM](https://user-images.githubusercontent.com/101255389/207794859-c221291b-0d7b-4b00-81f7-c48de05aab50.png)
List is empty
Actual behaviour
It doesn't show![Screenshot 2022-12-15 at 12 34 23 PM](https://user-images.githubusercontent.com/101255389/207794745-b34d877d-6b2c-4443-b3a6-72b0684a07e5.png)
List is empty
😄Miscellaneous
It's the display:none; that's causing the issue![Screenshot 2022-12-15 at 12 40 03 PM](https://user-images.githubusercontent.com/101255389/207795690-3671cc7b-4911-486c-86f7-6036b630b45a.png)