| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
PatternFly-React preview: https://2011-pr-patternfly-react-patternfly.surge.sh |
Sorry, something went wrong.
Codecov Report
@@ Coverage Diff @@
## master #2011 +/- ##
=========================================
Coverage ? 80.65%
=========================================
Files ? 660
Lines ? 8322
Branches ? 628
=========================================
Hits ? 6712
Misses ? 1310
Partials ? 300
Continue to review full report at Codecov.
|
Sorry, something went wrong.
|
@karelhala Can you review this one. |
Sorry, something went wrong.
| childrenToDisplay | ||
| ); | ||
| } | ||
| return React.createElement(scrollContainerComponent, scrollContainerProps, [ |
There was a problem hiding this comment.
I'll open an upstream PR to react-virtualized for this piece... the consumer should be able to override the default scroll elements rendered.
Sorry, something went wrong.
There was a problem hiding this comment.
this would also add support for the implementation of a virtual scrolling Data List in the future...
Sorry, something went wrong.
There was a problem hiding this comment.
i've opened #1377 upstream in react-virtualized. This would simplify the API consumption there quite a bit if merged.
Sorry, something went wrong.
|
Set a very long string in one of the columns: Seems the height of the row is not growing correctly and it's over writing the next two rows. Also, notice the column headers (like Workspaces) do not horizontally align with the row fields. |
Sorry, something went wrong.
|
The row height issue is not relevant as the height is computed based on the data. I changed the value via the inspector which does not cause a recompute. Sorry for any confusion. |
Sorry, something went wrong.
There was a problem hiding this comment.
Foo, this one is really big! Everything looks good, does this mean that we can change react tabular to fit our needs?
Sorry, something went wrong.
|
thanks @karelhala - i still have a couple todo's here. Will try to update the PR again soon. |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks great, thanks!! 👍
Sorry, something went wrong.
|
thanks @dlabaj and @redallen ! I would like to begin integration testing this downstream and open this as a prerelease for testing to others. I've filed #2179 for future follow up... let me know if anything else is needed before merge. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What:
Refactors #1250
Fixes #1229 #1628
Downstream PR:
openshift/console#1465
Q&A 🍿 🍰
What's wrong with reactabular-virtualized?
As noted in #1250 - dynamic row heights cause a problem when scrolling really long lists. In order to correctly calculate scroll offset, we need to measure all rows. We can't do this when the user drag scrolls an extremely long list. If using fixed heights though, this solution works perfectly fine.
Why bring in react-virtualized Grid source?
By default, Grid renders div's instead of tbody and tr's here. This negates all PF4 table styling for table body's and table row's.
Why am I not using @patternfly/react-table TableBody?
React-Virtualized uses absolute row positions to resolve dynamic row height issue mentioned above. This breaks the default layout for PF4 table rows. However, we can still emulate PF4 styling by assigning tr's with display: table; table-layout: fixed. As such, I am defining a new API surface for table body and table row which works with react-virtualized, but suggests the common use of Table/TableHeader for defining table headers.
Why am I going through this trouble?
OpenShift currently has very specific requests about emulating this virtualization behavior as well as retaining the existing mobile behavior. However, integrating @patternfly/react-table now will open the door for using our React tables out-of-the-box when virtualization is not needed. It should also work w/ vanilla PF4 if we were to choose pagination or infinite scroll for some other visualizations (rather than virtual scroll) giving us a more common API surface.
Running Demo:
https://2011-pr-patternfly-react-patternfly.surge.sh/patternfly-4/virtual%20scroll/virtualized/
A11Y notes:
The DOM structure allowed by react-virtualized does not fit conventional grid DOM hierarchy b/c it relies on having a nested rowgroup element that is scrollable. To resolve this issue, I am using the following fix for fixing incorrect DOM structures with roles/aria. I've tested it with VoiceOver on Mac and it seems to work quite well now. It also passes aXe audits in Chrome.
https://www.html5accessibility.com/tests/aria-table-fix.html
Additional A11y articles on this by Steve Faulkner:
https://developer.paciellogroup.com/blog/2014/10/notes-on-fixing-incorrect-table-structure-using-aria/
https://developer.paciellogroup.com/blog/2018/03/short-note-on-what-css-display-properties-do-to-table-semantics/
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_presentation_role
remaining todos:
cc: @rhamilto @suomiy
Additional issues: