-
Notifications
You must be signed in to change notification settings - Fork 13
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
Show horizontal table scrollbar only if necessary #200
Show horizontal table scrollbar only if necessary #200
Conversation
README.md
Outdated
This project uses [Storybook](http://storybook.js.org/) for testing the look and behavior of its UI components. | ||
|
||
```bash | ||
yarn storybook | ||
yarn start-storybook |
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.
Can we omit these changes? While they're good changes and I would generally accept them, they're out of scope for this PR.
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.
Hi again - I filed a separate PR for this: #204
8fba50e
to
996c709
Compare
Bump version to publish changes in #200
Bump version to publish changes in #200
Description
Main change
This pull request proposes setting the overflow-x CSS property of the table component to 'auto' to show the scrollbar only when it overflows its parent container.
Boyscouting
Furthermore, this pull request includes some boy-scouting changes to fix a link in the README and update the command to spin up the storybook to 'yarn start-storybook'. The old command, 'yarn storybook' did not work for me and, apparently, for many other people that asked about this on Slack. The answer to this question was usually: "Have you tried using 'start-storybook' instead? I took advantage of this pull request to update it.
Related Issue
N/A
Motivation and Context
Large tables were made scrollable back in 2021 by setting its overflow-x CSS property to 'scroll' 5343d38. While this indeed makes large tables scrollable, setting it to 'scroll' caused a horizontal scrollbar to appear also for smaller tables that do not require scrolling — see grey bar below table in screenshot. The aim of this pull request is to remove that scrollbar for small tables and show it only when necessary.
How Has This Been Tested?
This change was tested by manually opening a Parliament page with Google Chrome and updating the CSS property with its dev tools tab. See video demo below.
Screen.Recording.2024-02-28.at.23.33.15.mov
I tested the change locally with the storybook to assert that the change to src/Table/index.js updates the expected property.
Screenshots (if appropriate):
See above.
Types of changes
Checklist: