-
Notifications
You must be signed in to change notification settings - Fork 289
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 left and right shadows to indicate that the table is horizontally scrollable #58
Conversation
Can you include some screenshots? |
'fixedDataTableRowLayout/fixedColumnsDivider': left > 0, | ||
'fixedDataTableRowLayout/columnsShadow': this.props.scrollLeft > 0, | ||
'public/fixedDataTableRow/fixedColumnsDivider': left > 0, | ||
'public/fixedDataTableRow/columnsShadow': this.props.scrollLeft > 0, |
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.
Indent looks off here
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.
Fixed
'fixedDataTableRowLayout/columnsShadow': true, | ||
'fixedDataTableRowLayout/columnsRightShadow': true, | ||
'public/fixedDataTableRow/columnsShadow': true, | ||
'public/fixedDataTableRow/columnsRightShadow': true, |
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 think you can just do cx('class1', 'class2', ...);
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.
Fixed.
}, | ||
|
||
_renderColumnsRightShadow(/*number*/ totalWidth) /*?object*/ { | ||
if (this.props.scrollLeft + this.props.width + 0.5 < totalWidth) { |
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.
What is 0.5 magic number here?
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.
Changed to use 'Math.ceil' to roundup the value so it's more readable. There is a chance the shadow doesn't show nicely at an edgy case otherwise.
.public/fixedDataTableRow/columnsRightShadow { | ||
-webkit-transform: rotate(180deg); | ||
-moz-transform: rotate(180deg); | ||
-ms-transform: rotate(180deg); |
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.
We have postcss as part of the build step, so you don't need to manually include all prefixes
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.
Removed unnecessary prefixes.
left: left, | ||
height: this.props.height | ||
}; | ||
console.log("left shadow: ", className); |
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.
Remove
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.
Removed.
LGTM, thanks! |
Screenshots added
|
Added shadows to the table on both left and right sides to indicate the table is horizontally scrollable.
Description
When a table has many columns, horizontal scrollbar shows up to allow users to scroll horizontally to the right or the left to view columns on the two ends. The change adds shadows to one or both sides to indicate if there are columns not being exposed thus the table can be scrolled to view them.
Motivation and Context
Due to user experience tests, horizontal scrollbars are not clear enough to users that the they can scroll horizontally to view columns on the sides that are currently hidden. Having shadows makes it more clear and users can easily understand if they have hidden columns that they need to scroll to view.
How Has This Been Tested?
Very minor JavaScript code change and some simply CSS style change.
Manual testing only. No automated test. It has been tested in IE11+ (Win10), Edge(Win10), Chrome (MacOS), Safari(MacOS), Firefox(MacOS).
No impact on other area of the code is expected.
Types of changes
Checklist: