Skip to content

[EuiSuggest] Fix labelDisplay and add labelWidth and descriptionDisplay props#4180

Merged
andreadelrio merged 10 commits intoelastic:masterfrom
andreadelrio:suggest-expand
Oct 29, 2020
Merged

[EuiSuggest] Fix labelDisplay and add labelWidth and descriptionDisplay props#4180
andreadelrio merged 10 commits intoelastic:masterfrom
andreadelrio:suggest-expand

Conversation

@andreadelrio
Copy link
Copy Markdown
Contributor

Summary

This PR:

  • Fixes the issue where labelDisplay was not being passed from EuiSuggest to EuiSuggestItem
  • Adds labelWidth prop so consumers can set label to a width lower or higher than 50%. The motivation behind this is a use case reported in Kibana where it seems like labels are unnecesarily taking up too much space as they are using the current default (i.e. 50%).

image

  • Adds descriptionDisplay prop to handle cases with really long descriptions
  • Updates the docs example to include new props

image

Note: Need to fix one failing test

Fixes #4173

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, 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_4180/

@andreadelrio andreadelrio requested a review from cchaos October 27, 2020 01:29
@kibanamachine
Copy link
Copy Markdown

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

@kibanamachine
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

The only thing I see visually is that the wrapping version of the description could use some increase in line-height.

Screen Shot 2020-10-28 at 10 30 59 AM

@andreadelrio andreadelrio requested a review from cchaos October 28, 2020 17:58
@kibanamachine
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Looks great. I just have one last suggestion as I was confirming the class name logic.

@kibanamachine
Copy link
Copy Markdown

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

@andreadelrio andreadelrio merged commit b64b400 into elastic:master Oct 29, 2020
cchaos pushed a commit to andreadelrio/eui that referenced this pull request Nov 4, 2020
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.

[EuiSuggest] labelDisplay is not respected

3 participants