-
Notifications
You must be signed in to change notification settings - Fork 844
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
[BUG] Fix the EuiRange
prepend prop CSS
#7678
Merged
1Copenut
merged 6 commits into
elastic:main
from
1Copenut:bug/euiRangeInput-prepend-css
Apr 15, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f26a11c
[BUG][EuiRange]: Fixed input background color
1Copenut d36573f
Removed important and used Emotmotion specificity override instead.
1Copenut 70fb806
Switching to more specific background-color property.
1Copenut 2c388d0
Revert changes
cee-chen 75e35e3
Fix flex/width relationship of EuiRange inputs, ranges, and prepend/a…
cee-chen b620a63
changelog
cee-chen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
**Bug fixes** | ||
|
||
- Visual fixes for `EuiRange`s with `showInput`: | ||
- Longer `append`/`prepend` labels no longer cause a background bug | ||
- Inputs can no longer overwhelm the actual range in width | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,26 @@ export const euiRangeWrapperStyles = (euiThemeContext: UseEuiTheme) => { | |
display: flex; | ||
align-items: center; | ||
|
||
/* TODO: When converting forms to Emotion, allow passing wrapperProps | ||
to EuiFieldNumber and then move this CSS to range_input.styles.ts */ | ||
Comment on lines
+19
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This TODO is for myself once I start converting forms to Emotion |
||
> .euiFormControlLayout { | ||
/* There's no way to target the layout of the extra input, so we must | ||
* use the descendant selector to allow the width to shrink. */ | ||
/* Allow the width to shrink */ | ||
inline-size: auto; | ||
/* Don't allow inputs to overwhelm the actual range in width */ | ||
max-inline-size: 50%; | ||
|
||
/* The input should take priority over prepend/append labels */ | ||
.euiFormControlLayout__childrenWrapper { | ||
flex-shrink: 0; | ||
} | ||
|
||
.euiFormControlLayout__prepend, | ||
.euiFormControlLayout__append { | ||
flex-shrink: 1; | ||
/* Remove the default 50% max-width on prepend/appends, as a max-width is | ||
already set on the wrapper, and a static width already set on the input */ | ||
max-inline-size: none; | ||
} | ||
} | ||
`, | ||
regular: css` | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 to @mgadewoll for pointing out this visual bug and getting me on the right track of the underlying bug!