0

We are using lightning-combobox (in lwc) to display a dynamic dropdown list. We are adding just the standard 2 attributes per option i.e label and value. When a user hovers on any of the options, then the label is displayed as the hover text. Is there a way to customize that hover text? I tried adding "title" as an attribute to the option, but that did not have any effect.

enter image description here

2
  • Can you add an example and screenshot on whats missing? Commented Jun 21, 2021 at 23:55
  • @MohithShrivastava I added a screenshot above. The hover text always shows the same value as the label, even if we add the title attribute to the option. You can also see this in the LWC reference for lightning-combobox: developer.salesforce.com/docs/component-library/bundle/… Commented Jun 22, 2021 at 4:01

1 Answer 1

1

Out of the box, this is not possible as of today as this is not exposed for component consumers to override this behavior.

However, if you want this functionality I would look into the source code that's available here.

There is a hierarchy below of components forming this component.

combobox baseCombobox baseComboboxItem baseComboboxFormattedText 

All you will need to do is modify the component to make sure the title is passed.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.