Skip to content
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

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

Merged
merged 10 commits into from
Oct 29, 2020

Conversation

andreadelrio
Copy link
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

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

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

@kibanamachine
Copy link

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

Copy link
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

src/components/suggest/suggest_item.tsx Outdated Show resolved Hide resolved
src/components/suggest/suggest_item.tsx Outdated Show resolved Hide resolved
src/components/suggest/suggest_item.tsx Outdated Show resolved Hide resolved
src/components/suggest/suggest_item.tsx Outdated Show resolved Hide resolved
src/components/suggest/suggest_item.tsx Outdated Show resolved Hide resolved
src/components/suggest/suggest.tsx Outdated Show resolved Hide resolved
src-docs/src/views/suggest/suggest_example.js Show resolved Hide resolved
@andreadelrio andreadelrio requested a review from cchaos October 28, 2020 17:58
@kibanamachine
Copy link

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

Copy link
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.

src/components/suggest/suggest_item.tsx Outdated Show resolved Hide resolved
@kibanamachine
Copy link

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