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.
- Can you add an example and screenshot on whats missing?Mohith Shrivastava– Mohith Shrivastava ♦2021-06-21 23:55:50 +00:00Commented 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/…hamayoun– hamayoun2021-06-22 04:01:52 +00:00Commented Jun 22, 2021 at 4:01
Add a comment |
1 Answer
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.
