-
Notifications
You must be signed in to change notification settings - Fork 3
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
[sc-46254] Add CSS style for vertical scroll #236
[sc-46254] Add CSS style for vertical scroll #236
Conversation
4788c15
to
996855b
Compare
996855b
to
719bb66
Compare
|
||
.vscroll-wrapper { | ||
display: inline-block; | ||
height: var(--vertical-scroll-height); |
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'd rather have that as 100% and have the container in the app fix the height. Case is, in the Studio we often define height by ratio.
This implies adding an height: 100%; flex-wrap: no wrap;
on the Card.
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.
done
@@ -47,6 +47,8 @@ | |||
--spacing-75: 9px; | |||
--spacing-100: 13px; | |||
--border-color: #cbd2db; | |||
--header-background-color: #ffffff; | |||
--vertical-scroll-height: 20em; | |||
/* FIXME: Only using flex style to center source link */ | |||
display: flex; |
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.
Could a use a flex-wrap: nowrap
. It's a direct consequence of this PR, but it becomes more obvious now. Else we can end up in horizontal layout in some cases.
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.
done
@@ -28,6 +28,12 @@ Playground.args = { | |||
options, | |||
}; | |||
|
|||
export const VerticalScroll = Template.bind({}); |
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.
So if we go for the 100% on the Table, we'll need to add a container with a fixed height (and maybe one with an aspect-ratio
?) to match our use cases.
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.
The container was added to the story but I did not create a new story withaspect-ratio
(I did not know the property)
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.
Just one thing about height, that I would prefer to have set by the outer app, notably for our aspect ratio use case.
Else I'm fine with all the implem: sticky, conditional class, props to header 👌
I agree with Etienne; developers using our library need to be able to set the height of the table. You can see that major UI libraries expose a prop to control the max height of the table body:
We just need to find what fits us. |
b3b4ca0
to
0612f11
Compare
@cybervinvin with the latest merges, we now have conflicts in this PR (so sorry 🥹 ) No rush to fix it. Please stay focus on your dev (loading state) and your reviews |
No problem, I'll fix it 😉 |
More details: - add `verticalScroll` property - add new CSS entry `header-background-color` - add new CSS entry `vertical-scroll-height` - `thead` is sticky on top - new story for `Vertical Scroll`
After code review, `Card` should have a height of 100% to allow better control from the application.
0612f11
to
a465256
Compare
We will re-open it when we are asked to support it. |
Summary
The goal for this PR is to add a fixed header when the
Table
is scrollable vertically.(Internal for Opendatasoft only) Associated Shortcut ticket: sc-46254.
vscroll.mov
Changes
verticalScroll
propertyheader-background-color
vertical-scroll-height
thead
is sticky on topVertical Scroll
Breaking Changes
None
Changelog
In the
Table
component, the header is now sticky on top when the table is scrollable vertically.Open discussion
When the
verticalScroll
property is set totrue
, table height is set arbitrarily and the background color too (default: #ffffff). It's not ideal but I don't see an alternative.To be tested
A new story has been created for storybook.
Review checklist