-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[table] feat(Table2): new 'scroll' instance method #5968
Conversation
… modifications (v0)
lint fix, also added some basic doc stringsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
ran prettierBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
created basic demoBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
making demo a little nicerBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
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.
In general, the idea of a Table2.prototype.scroll
instance method sounds fine; it seems reasonable to add this next to the existing scrollToRegion
instance method. But we'll need to do some work to make it more usable.
First off, there should be some visual indication that the user is triggering a scroll. One idea for this would be to add a linear gradient that fades from partially-transparent $black
to fully-transparent $black
at the top / bottom of the table's main quadrant. This could be supported with modifier classes on the <Table2>
component, something like Classes.TABLE_BODY_IS_SCROLLING_{TOP|LEFT|BOTTOM|TOP}
.
Secondly, the example needs to have improved scroll trigger behavior. When I move my mouse back towards the middle of the table (away from the 30% top or bottom regions), the scrolling should stop immediately. It shouldn't continue as an automatic animation.
For documentation, you should add to the "Instance methods" section of the table docs:
@### Instance methods |
remove unnecessary copyrightBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Co-authored-by: Adi Dahiya <adahiya@palantir.com>
small fixesBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
removed cruft and will-change editsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Updated to fix scrolling behavior to be more responsive. Added both a cursor, and a visual overlay affect to show the user is scrolling. Interested for feedback on setScrollOverlayBackground, I initially worked it as a setScrollIndicator (left, right, top,..) function, but decided that this seemed too rigid. Perhaps this is too custom though? |
merged scroll and setScrolling indicator into setScrollingBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
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.
nice, this is looking pretty close!
I would suggest adding this to the main mutableTable example, with a toggle to enable the behavior (titled something like "Demo programmatic scrolling API" in the sidebar)
some small polish items, if possible (might be ok to address as follow-ups):
- sometimes the scroll indicator sticks around after you mouse off and reach the end of the table, like at the end of this gif:
- sometimes it keeps scrolling after I've moused off quickly, like this:
Co-authored-by: Adi Dahiya <adahiya@palantir.com>
Co-authored-by: Adi Dahiya <adahiya@palantir.com>
Co-authored-by: Adi Dahiya <adahiya@palantir.com>
…if not scrolling.
was able to fix the first issue, second one is still eluding me, but hoping we can fix that as a flup? Also merged my example into the existing with the switch being "Demo programmatic scrolling API" |
adding enum that was accidentally ommittedBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
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.
almost there!
yes it's fine to fix that second issue as a FLUP
…instance methods api
…hen demoing the scrolling api
removing more cruftBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Copied over the instance method from table 2 into table as well, apparently it was required for the documentation to port into the instance method docs, and I assume that both should have it anyhow. Also added the documentation. There is a little funkiness with the formatting though, @adidahiya do you have any dots? |
The above is capitalized correctly in the commits I made ftr, just forgot to recompile |
making certain state properties private class propertiesBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
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.
use table2 for documentation stringBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Fixes #5915
Enables functionality which can address this scroll issue
Checklist
Changes proposed in this pull request:
Table2.prototype.scroll()
which allows users to manually scroll the table by a given left / top offset in pixelsReviewers should focus on:
If this change makes sense as a "enable-new-feature" solution to the above issue, vs changing default table behavior. Also that the new "scroll" function behavior makes sense for general context.
Screenshot