-
Notifications
You must be signed in to change notification settings - Fork 863
[EuiListGroupItem] Adding a toolTipProps spread operator to allow tooltip customization
#7018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
9b5d2ca
35aed30
73fbd9a
e426c3a
ba277cd
9c741d7
1c9d522
3f9b318
0c98496
15c4c7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
cee-chen marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ import React, { | |
| import classNames from 'classnames'; | ||
|
|
||
| import { EuiIcon, IconType, EuiIconProps } from '../icon'; | ||
| import { EuiToolTip } from '../tool_tip'; | ||
| import { EuiToolTip, EuiToolTipProps } from '../tool_tip'; | ||
| import { useInnerText } from '../inner_text'; | ||
| import { ExclusiveUnion, CommonProps } from '../common'; | ||
| import { | ||
|
|
@@ -144,6 +144,11 @@ export type EuiListGroupItemProps = CommonProps & | |
| * By default the text will be same as the label text. | ||
| */ | ||
| toolTipText?: string; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [not a change request, just me thinking out loud] I wonder if we should consider deprecating this prop in favor of telling consumers to use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I lean toward keeping it. Agree with you it's a nice API and saves a few keystrokes if folks want to just add a custom string the tooltip than string plus N number more change. |
||
|
|
||
| /** | ||
| * Props can be passed to nested`EuiToolTip`. | ||
cee-chen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| */ | ||
| toolTipProps?: EuiToolTipProps; | ||
cee-chen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| export const EuiListGroupItem: FunctionComponent<EuiListGroupItemProps> = ({ | ||
|
|
@@ -166,6 +171,7 @@ export const EuiListGroupItem: FunctionComponent<EuiListGroupItemProps> = ({ | |
| wrapText, | ||
| buttonRef, | ||
| toolTipText, | ||
| toolTipProps, | ||
| ...rest | ||
| }) => { | ||
| const isClickable = !!(href || onClick); | ||
|
|
@@ -330,6 +336,7 @@ export const EuiListGroupItem: FunctionComponent<EuiListGroupItemProps> = ({ | |
| content={toolTipText ?? label} | ||
| position="right" | ||
| delay="long" | ||
| {...toolTipProps} | ||
1Copenut marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| > | ||
| {itemContent} | ||
| </EuiToolTip> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - Added `toolTipProps` to `EuiListGroupItem` to customize nested tooltips. | ||
cee-chen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Uh oh!
There was an error while loading. Please reload this page.