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

Fix euiFormControlIsLoading mixin to prevent the loading icon overlapping when compressed #3401

Conversation

elizabetdev
Copy link
Contributor

@elizabetdev elizabetdev commented Apr 29, 2020

Summary

This PR fixed the euiFormControlIsLoading SASS mixin to prevent the loading icon from overlapping with the text when the form control is compressed and has an icon on the right side.

I noticed this issue when I was working on the EuiColorPalettePicker.

form-control@2x

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

@elizabetdev elizabetdev requested a review from cchaos April 29, 2020 11:53
@kibanamachine
Copy link

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

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.

Good catch! Don't know how it wasn't noticed before. Might have happened when we moved around the mixins.

Looking at the allocated padding, I think we actually have too much. Both in compressed and non-compressed. Could you also adjust the amount of padding so that the text gets a little closer to the icons?

Screen Shot 2020-04-30 at 12 08 47 PM

Screen Shot 2020-04-30 at 12 11 33 PM

@@ -115,7 +115,8 @@

@mixin euiFormControlIsLoading($isNextToIcon: false) {
@at-root {
#{&}-isLoading {
#{&}-isLoading,
#{&}-isLoading#{&}--compressed {
@if ($isNextToIcon) {
@include euiFormControlLayoutPadding(2);
Copy link
Contributor

Choose a reason for hiding this comment

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

This mixin actually takes a third parameter for $compressed: true which alters the padding to be better suited for the compressed version. You'll likely need to just move the compressed selector to it's own block and pass this param in.

@mixin euiFormControlLayoutPadding($numOfIcons, $side: 'right', $compressed: false) {

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@elizabetdev elizabetdev requested a review from cchaos May 5, 2020 18:08
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.

Thanks for adjusting these. Even though it's more verbose, the padding calculations are easier to follow.

@elizabetdev elizabetdev merged commit ed8ba9d into elastic:master May 6, 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.

3 participants