-
Notifications
You must be signed in to change notification settings - Fork 50
[terra-clinical-item-view] Set min height so blank displays show up as an empty line #919
Conversation
@RayGunY - thanks for the detailed explanation. I support your implementation and think the concern you raised can be addressed in the implementation guide. |
|
||
.content { | ||
min-height: 1.25em; // Setting a line height so when a blank display is passed in the content maintains it's height instead of shrinking | ||
} |
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.
Ideally I think we would want to apply this min height only when the display is empty. However I wasn't able to figure out how to do that. I tried some variations of the below, but I must be missing something. If needed I think it should be fine to not set min height on just the empty displays, this 1.25em value doesn't mess with any of the other snapshots.
.content:blank {
min-height: 1.25em;
}
.content:empty {
&::before {
min-height: 1.25em;
}
}
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 am curious if we are able to set it on the implementation side. Maybe adding the display empty check here https://github.com/cerner/terra-clinical/blob/blank-display-height-fix/packages/terra-clinical-item-view/src/ItemView.jsx#L210-L212?
This issue has been automatically marked as inactive because it has not had recent activity. It will be closed in seven days if no further activity occurs. Thank you for your contributions. |
Summary
What was changed:
Added a minimum height for the display content. Setting it to 1em for the min because that didn't mess with any of the other snapshots sizing/spacing. When I tried setting it to 1.4285em like the other line heights show up in the browser that changed the screenshots so it looks like we need a smaller line height.
Why it was changed:
Noticed that blank lines were not showing up when passing in an empty item display. The display is technically there but has no height because it's essentially an empty span. See below for reference.
Seems that some users potentially add blank displays to an item view for styling purposes, so we should make sure we're still honoring those blank lines.
Testing
This change was tested using:
Reviews
In addition to engineering reviews, this PR needs:
Additional Details
This PR resolves:
No issue has been created for this since it's such a small change, if that needs to change let me know and I can log something.
Validation that nothing is read out for those empty displays and that screenreader focus does not shift to the empty newlines.
VO-no-readout-for-empty-displays.mov