-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EuiComboBox] add support for option tooltips (#7700)
Co-authored-by: Cee Chen <[email protected]> Co-authored-by: Tomasz Kajtoch <[email protected]>
- Loading branch information
1 parent
67a0675
commit 079cce4
Showing
14 changed files
with
670 additions
and
404 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- Updated `EuiComboBox`'s `options` to support including tooltip details for selectable options. Use `toolTipContent` to render tooltip information, and `toolTipProps` to optionally customize the tooltip rendering behavior | ||
|
||
**Bug fixes** | ||
|
||
- Fixed a visual layout bug for `EuiComboBox` with `isLoading` in mobile views | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Added a new, optional `optionMatcher` prop to `EuiSelectable` and `EuiComboBox` allowing passing a custom option matcher function to these components and controlling option filtering for given search string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React, { useState } from 'react'; | ||
|
||
import { | ||
EuiComboBox, | ||
EuiComboBoxOptionOption, | ||
} from '../../../../src/components'; | ||
|
||
const options: Array<EuiComboBoxOptionOption<string>> = [ | ||
{ | ||
label: 'Titan', | ||
toolTipContent: | ||
'Titan is the largest moon of Saturn and the second-largest in the Solar System', | ||
}, | ||
{ | ||
label: 'Pandora', | ||
toolTipContent: | ||
"Pandora is one of Saturn's moons, named for a Titaness of Greek mythology", | ||
}, | ||
{ | ||
label: 'Iapetus', | ||
toolTipContent: "Iapetus is the outermost of Saturn's large moons", | ||
toolTipProps: { position: 'bottom' }, | ||
}, | ||
]; | ||
export default () => { | ||
const [selectedOptions, setSelected] = useState([options[2]]); | ||
|
||
const onChange = ( | ||
selectedOptions: Array<EuiComboBoxOptionOption<string>> | ||
) => { | ||
setSelected(selectedOptions); | ||
}; | ||
|
||
return ( | ||
<EuiComboBox | ||
aria-label="Example of combobox options with tooltips" | ||
options={options} | ||
selectedOptions={selectedOptions} | ||
onChange={onChange} | ||
isClearable={true} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.