1

Looking at the Lightning Design System's Combobox documentation, it has an example showing the styling for disabled list-items.

However, looking at the LWC lightning-combobox element, I can't see a way of creating disabled combobox list-items. I have tried adding disabled: true, or disabled: 'disabled' to the option objects for the list items, but it doesn't have any effect.

Is there a way to use the out-of-the box LWC lightning-combobox element to show some disabled list-items?

1

2 Answers 2

3

The lightning-combobox component does not implement most of the SLDS specification, much to my annoyance. I actually wrote my own combobox so I could implement the filter functionality (but I haven't implemented disabled items myself yet, as I don't have a use for it). You'll need to write your own component if you want some of those more advanced features.

1
  • OK. Good to know. Thanks very much.
    – lemming
    Dec 3, 2020 at 9:57
0

There is a custom LWC based combobox component https://github.com/NPSINGH/LWC-Combobox, which inherit all the styling from the Lightning Combobox design blueprint https://www.lightningdesignsystem.com/components/combobox/. I'm not sure whether it supports the disabled property in options, but you can easily manipulate it since the source code is on Github.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .