ttskch / select2-bootstrap4-theme

Select2 v4 theme for Bootstrap4
MIT License
435 stars 206 forks source link

Styling is missing Disabled options #60

Open kobitate opened 4 years ago

kobitate commented 4 years ago

Dropdown is not showing proper styling for disabled options (Bulloch Animal Shelter in the example below)

{
   "results":[
      {
         "id":"1",
         "text":"Community",
         "disabled":false
      },
      {
         "id":"2",
         "text":"Bulloch Animal Shelter",
         "disabled":true
      },
      {
         "id":"3",
         "text":"Metter Animal Shelter",
         "disabled":false
      },
      {
         "id":"4",
         "text":"Evans County Animal Shelter",
         "disabled":false
      }
   ],
   "pagination":{
      "more":false
   }
}

Select2 default theme:

image

With this repo theme. item is disabled but not styled as such:

image
squatto commented 4 years ago

You can correct this by adding this to your site's CSS:

.select2-container--bootstrap4 .select2-results__option[aria-disabled=true] {
    color: #999;
}

I'm open to submitting a PR to fix this, but it seems like the repo is stale (no PRs have been merged since 2019)

tagliala commented 3 years ago

I've fixed this into #67

squatto commented 3 years ago

Thank you @tagliala !