-
Notifications
You must be signed in to change notification settings - Fork 67
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
Add sticky option to Table #1001
Comments
Could this sticky option also support sticky columns? |
Good question. We are planning on bringing this up for discussion on todays planning meeting as we are not sure wether we should implement this inside the component or let users do it themselves based on needs. The solution is pretty straight forward, example using styled-components here: const StickyTopCell = styled(Cell)`
position: sticky;
top: 0; A sticky column first or last column would then be just changing the position of the element from const StickyLeftCell = styled(Cell)`
position: sticky;
left: 0; const StickyRightCell = styled(Cell)`
position: sticky;
right: 0; |
Can you have a check @BirteThornquist Little bit unsure how to solve this one in Figma. If we want the drop shadow effect, either we have to introduce a new variant for the whole component or we have to introduce a "line" asset. |
@lucasveil @BirteThornquist Don't forget we also need to verify that the design works in code :) |
No worries @mimarz, we have that in the back of our head. We will have a review with dev when we are ready with the design. |
@equinor/eds-ux agreed on a drop shadow effect that will need to be implemented in code for sticky table header |
ok, which elevation type did you use? |
Going with sticky. Will update documentation for design but will not be a component in the library. |
Ok, I will update react component |
Our example of sticky Table header does not work, becauseposition:sticky
onthead
messes with its width. 😫Usingposition:sticky
onth
does work, but a bug in styled-components withas
, prevents us from extending our<Cell />
withstyled()
as it looses all its styling applied in the component.The bug as been "fixed" by styled-components by introducing aforwardedAs
which is intended to be used, but as long as there is an "as" prop (even when used for something completely else)styled-components
fumbles#997 Fixes our issue with not being able to style/extend
<Cell />
for our users.Suggest we introduce a
sticky
prop to Table or Head, which applies the necessary css to ourth
for it to be sticky. This should avoid confusion and make it easier to our users to apply it without having to extend<Cell />
.Notes:
The text was updated successfully, but these errors were encountered: