-
Notifications
You must be signed in to change notification settings - Fork 58
refactor: use theme spacing for Select min height #317
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
base: master
Are you sure you want to change the base?
Conversation
🟡 Heimdall Review Status
🟡
|
| Code Owner | Status | Calculation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ui-systems-eng-team |
🟡
0/1
|
Denominator calculation
|
| const LABEL_VARIANT_INSIDE_HEIGHT = 32; | ||
| const COMPACT_HEIGHT = 40; | ||
| const DEFAULT_HEIGHT = 56; | ||
| const LABEL_VARIANT_INSIDE_HEIGHT = 'var(--space-4)'; |
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.
@haoruikun-cb won't the values be string instead of number now?
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 is fine since HStack minHeight props takes in either number or string
| const DEFAULT_HEIGHT = 56; | ||
| const LABEL_VARIANT_INSIDE_HEIGHT = 'var(--space-4)'; | ||
| const COMPACT_HEIGHT = 'var(--space-5)'; | ||
| const DEFAULT_HEIGHT = 'var(--space-7)'; |
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.
I'm nervous for how this approach would act in cases where spacing is increased.
If their unit spacing = 12px but their fonts stay the same the input would be too large now.
It still could very well likely be an improvement over the current approach, I'm not sure how the current min height code would act.
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.
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 example with spacing is smaller (1 space = 4px) our min height is 28px but we get 36px. So even though our min height doesn't match it is still the correct size.
When we have larger spacing (1 space = 16px) our min height is 112px but yet it should be 72 based on this inner Select sizing.
So we are off however the output isn't too bad I suppose
When comparing this with TextInput though, they only align correctly at the default spacing (and when labelVariant does not equal inside hmm)
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.
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.
Yeah you are right. Let me investigate how we can refactor this to fix the intrinsic height.


What changed? Why?
Refactor Select to use theme token for min height, so it can react to ThemeProvider changes like TextInput.
Root cause (required for bugfixes)
UI changes
Testing
How has it been tested?
Testing instructions
Illustrations/Icons Checklist
Required if this PR changes files under
packages/illustrations/**orpackages/icons/**Change management
type=routine
risk=low
impact=sev5
automerge=false