Skip to content

[EuiComboBox] Added custom option text prop#3811

Merged
elizabetdev merged 9 commits intoelastic:masterfrom
elizabetdev:combo-box-custom-option-text
Aug 3, 2020
Merged

[EuiComboBox] Added custom option text prop#3811
elizabetdev merged 9 commits intoelastic:masterfrom
elizabetdev:combo-box-custom-option-text

Conversation

@elizabetdev
Copy link
Copy Markdown
Contributor

@elizabetdev elizabetdev commented Jul 28, 2020

Summary

Closes #3702.

This PR adds a customOptionText prop to EuiComboBox. Consumers can pass customOptionText="Add {searchValue} as your occupation" to customize the custom option text.

This can be tested on Single selection with custom options section.

Screenshot

Screenshot 2020-07-28 at 15 53 24

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • [ ] Checked in mobile
  • Checked in IE11 and Firefox
  • Props have proper autodocs
  • Added documentation
  • [ ] Checked Code Sandbox works for the any docs examples
  • Added or updated jest tests
  • [ ] Checked for breaking changes and labeled appropriately
  • [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_3811/

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_3811/

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_3811/

…ons_list.tsx

Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_3811/

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_3811/

Copy link
Copy Markdown
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small change to make React happy, otherwise this looks good!

elizabetdev and others added 2 commits August 3, 2020 21:17
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_3811/

Copy link
Copy Markdown
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Pulled & tested locally

@elizabetdev elizabetdev merged commit 1d459ce into elastic:master Aug 3, 2020
nyurik pushed a commit that referenced this pull request Aug 18, 2020
* Added custom option text prop

* Added CL number

* Removing unecessary span

* Adding highlight search value function

* Update src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx

Co-authored-by: Chandler Prall <chandler.prall@gmail.com>

* Update src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx

Co-authored-by: Chandler Prall <chandler.prall@gmail.com>

Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiComboBox] Add an option to configure wording and display of "Hit Enter to add ... as a custom option"

3 participants