Skip to content
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

feat(data table manager): fix data table manager scroll issue #2852

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/quiet-eagles-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@commercetools-uikit/data-table': minor
---

When there is a horizontally long table that requires scrolling.
The user should be able to horizontally scroll only the table container without any other element of view scrolling along.
2 changes: 1 addition & 1 deletion packages/components/data-table/src/data-table.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const TableContainer = styled.div<TTableContainer>`

${(props) =>
// this is needed in order to have a sticky header
props.maxHeight ? `overflow-x: auto;` : ''}
props.maxHeight ? `overflow-x: auto;` : 'overflow-x: scroll;'}
Copy link
Contributor

@misama-ct misama-ct Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
props.maxHeight ? `overflow-x: auto;` : 'overflow-x: scroll;'}
overflow-x: auto;

In theory, auto is solving the same problem as scroll does, but in a more elegant way. Introducing scrollbars only when needed instead of having them visible at all times. This should be sufficient, if it is a scrolling-issue. Can you verify?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, I realised and moved it back to wip. Thank you 🙏🏾


${(props) =>
props.maxWidth && !props.disableSelfContainment
Expand Down
Loading