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

Improve EuiComboBox to unsure the input doesn't drop to the next line when badges are long #3968

Merged
merged 6 commits into from
Aug 27, 2020

Conversation

miukimiu
Copy link
Contributor

Summary

This PR closes #3775. Long badges were creating a new line for the hidden input.

Tho fix the issue as @snide suggested on #3775 I changed the default EuiBadge max-width: 100% and did a calc that subtract the width of the hidden input plus a small margin.

I also noticed that there was an issue with long badges when isClearable={false} and compressed={true}. As we can see here: https://codesandbox.io/s/fervent-bardeen-up43t?file=/index.js

Combobox badge long text@2x

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

@miukimiu miukimiu changed the title Ensure the input doesn't drop to the next line Improve EuiComboBox to unsure the input doesn't drop to the next line when badges are long Aug 26, 2020
@kibanamachine
Copy link

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

Copy link
Contributor

@andreadelrio andreadelrio left a comment

Choose a reason for hiding this comment

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

This is working nicely, just had a suggestion about variables and the CL.

CHANGELOG.md Outdated
@@ -6,6 +6,7 @@
- Removed docgenInfo from non-docs production builds ([#3911](https://github.com/elastic/eui/pull/3911))
- Added `regressionJob`, `outlierDetectionJob` and `classificationJob` icons to Machine Learning icon set, updated others. ([#3931](https://github.com/elastic/eui/pull/3931))
- Added `operator` field to `EuiSearchBar`'s `field_value_selection` filter configuration ([#3922](https://github.com/elastic/eui/pull/3922))
- Improved `EuiComboBox` styles to unsure the input doesn't drop to the next line when `EuiBadge` has a very long text ([#3968](https://github.com/elastic/eui/pull/3968))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this entry would fall under Bug Fixes since this was a small bug.

src/components/combo_box/_combo_box.scss Outdated Show resolved Hide resolved
src/components/combo_box/_combo_box.scss Outdated Show resolved Hide resolved
@kibanamachine
Copy link

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

@miukimiu
Copy link
Contributor Author

Thanks, @andreadelrio for suggesting those changes! 🎉

@kibanamachine
Copy link

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

Copy link
Contributor

@andreadelrio andreadelrio left a comment

Choose a reason for hiding this comment

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

🚀 LGTM

@miukimiu miukimiu merged commit 52f00a7 into elastic:master Aug 27, 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.

Long EuiComboBox option causes parent EuiFlexItem to wrap
3 participants