Select2: Hide certain options dynamically

前端 未结 10 797
情深已故
情深已故 2020-12-03 06:56

Basically what I\'m looking for is the ability to hide options from the dropdown of select items. So, technically they would still be options, but you just wouldn\'t be able

10条回答
  •  盖世英雄少女心
    2020-12-03 07:13

    this is small varation of the accepted answer, actually I had to modify the accepted answer to make it work, I had to change the class names, maybe this is because different versions of Select2 library

    .select2-results__options .select2-results__option[aria-disabled=true] {
       display: none;
    }
    

提交回复
热议问题