-
Notifications
You must be signed in to change notification settings - Fork 842
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
Fix euiFormControlIsLoading mixin to prevent the loading icon overlapping when compressed #3401
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_3401/ |
There was a problem hiding this 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?
src/global_styling/mixins/_form.scss
Outdated
@@ -115,7 +115,8 @@ | |||
|
|||
@mixin euiFormControlIsLoading($isNextToIcon: false) { | |||
@at-root { | |||
#{&}-isLoading { | |||
#{&}-isLoading, | |||
#{&}-isLoading#{&}--compressed { | |||
@if ($isNextToIcon) { | |||
@include euiFormControlLayoutPadding(2); |
There was a problem hiding this comment.
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) { |
…loading-issue-when-compressed
Preview documentation changes for this PR: https://eui.elastic.co/pr_3401/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3401/ |
There was a problem hiding this 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.
Summary
This PR fixed the
euiFormControlIsLoading
SASS mixin to prevent the loading icon from overlapping with the text when the form control iscompressed
and has an icon on the right side.I noticed this issue when I was working on the EuiColorPalettePicker.
Checklist
[ ] Checked in mobile[ ] 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