Posts

Showing posts with the label Combobox

Salesforce Fact #798 | Getting selected label from lwc combobox

Image
While using lightning-combobox, we can get the selected option value using event.detail.value, but not the label. To get the selected label, we need to use a bit of logic. Attached is the screenshot.

Salesforce Fact #706 | Optional description attribute in lwc combobox option

Image
We can use one optional attribute 'description' for each option in lightning-combobox. The descriptive text displays below the option label and can be helpful to the user. Reference:  https://developer.salesforce.com/docs/component-library/bundle/lightning-combobox/documentation Attached are the screenshots.

Salesforce Fact #653 | Reset value in combobox

Image
Suppose we have a scenario in LWC where we need to reset the value of the combobox on button click. We can achieve this using template.querySelector(). Attached are the screenshots.

Salesforce Fact #551 | readOnly combobox in LWC

Image
Suppose there is a use case to disable a lightning combobox on selection of a particular option. We can implement the same using the 'read-only' attribute. Attached are the screenshots.