eui
eui copied to clipboard
Add `tooltipContent` and `tooltipProps` support for EuiComboBox and EuiSelectable options
Requested by the Cloud team to replace long description text for roles. They would like to ship this by the end of the month.
See similar existing APIs:
https://github.com/elastic/eui/blob/f10c46d86d2e20d6e4f78a16e8c0c5a1c79703b1/src/components/button/button_group/button_group.tsx#L56-L63
https://github.com/elastic/eui/blob/68439d3af0f0e26284b98a8d0e719b6918861731/src/components/context_menu/context_menu_item.tsx#L47-L55
Tooltips should also be toggled by keyboard "focus" (which isn't true focus in the case of EuiSelectable)
@cee-chen Do you have more context to link here?
Original design that tooltips are intended to replace:
The tooltips replace the non-essential descriptions and will gain back valuable screen real estate.
Scope of work:
API considerations:
- API should go on the
optionobject/type, not on the top-level component - It should be possible for mixed usage (i.e., some options to have tooltip content and some options to not have tooltips).
- Please start with adding the new prop to
EuiComboBoxfirst (higher priority). EuiSelectable is nice to have and will be needed for #2841, but can also wait if needed.
UX considerations:
- Triggering the tooltip on keyboard "focus" is going to require some amount of trickery/workaround as focus is technically on the search input and not on the actual list item. If this is too complicated to do, let's punt it to a separate follow-up PR and focus on mouse functionality first.
- Default tooltip delay to short and not long, please (per recent conversations with Marcialis)
- (OPTIONAL) We may want to consider automatically rendering the
iInCircleicon iftooltipContentexists and has been passed, to let users know that the content exists. Would be open to thoughts on this or if we should just let users decide this themselves via theappendorprependproperties