-
Notifications
You must be signed in to change notification settings - Fork 859
[EuiComboBox] add support for option tooltips #7700
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
Merged
mgadewoll
merged 21 commits into
elastic:main
from
mgadewoll:feat/7690-combobox-option-tooltip-support
May 3, 2024
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
34153a7
feat(EuiToolTip): add controlled isOpen support
mgadewoll 63721a9
feat(EuiComboBox): add EuiToolTip support on option
mgadewoll 0734902
test(EuiComboBox): add tests for toolTipContent and toolTipProps
mgadewoll 5813c35
fix(EuiComboBox): fix isLoading layout for mobile
mgadewoll c3e19f8
docs(storybook): add separate tooltip story for ComboBox
mgadewoll 7615fa1
test(EuiComboBox): update input options placement
mgadewoll ad0a3c5
refactor(EuiComboBox): prevent tooltip props from being applied on input
mgadewoll 3c66b43
docs(EuiComboBox): add EuiDocs example
mgadewoll 7b5236c
chore: add changelog
mgadewoll 664dc88
refactor: revert adding isOpen on EuiToolTip and use ref API for show…
mgadewoll ffc84a9
refactor: use remove tooltip wrapper in favor of using anchorProps fo…
mgadewoll 90197c5
chore: add PR feedback
mgadewoll fee66ff
docs: update EuiComboBox tooltip docs example
mgadewoll 67a9db7
chore: cleanup wrongly removed type check
mgadewoll b8ebf61
chore: add comment
mgadewoll 7e48f0a
Fix Firefox behavior by checking for `scrollTarget.contains`
cee-chen aa016c1
Update/add Cypress tests
cee-chen dbd8866
test(VRT): add base snapshots for EuiComboBox
mgadewoll 8c1b693
feat: Add `optionMatcher` prop to `EuiSelectable` and `EuiComboBox` c…
tkajtoch c50b604
docs(storybook): add separate tooltip story for ComboBox
mgadewoll 9929c3e
chore: cleanup
mgadewoll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.