This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DEX-922 implement stickyHeader and add a meaningful maxHeight to ever… #430
DEX-922 implement stickyHeader and add a meaningful maxHeight to ever… #430
Changes from 2 commits
a43d331
a12ea15
1873372
c1cb541
47f19e8
d9f0f7b
ffcc2ad
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Should there be a
maxHeight
on paginated tables. If we want the table to be shorter, shouldn't we just reduce the request page size?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.
That's a good point. Are we convinced that every instantiation of IndividualsDisplay is going to be paginated?
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.
IndividualsDisplay
passes itsrest
props to itsDataDisplay
component, so if an instance would rather have a maximum height than be paginated, it can passmaxHeight
.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.
Ok, I've noticed two weird things now:
When passing maxHeight to IndividualsDisplay, the DataDisplay does NOT seem to be respecting it:
<IndividualsDisplay
individuals={searchResults || []}
hideFilterSearch
loading={loading}
sortExternally
searchParams={searchParams}
setSearchParams={setSearchParams}
dataCount={resultCount}
style={{ maxHeight: 600 }}
/>
The limit: 20 param in useFilterIndividuals.js also seems not to be respected. I created an investigation ticket for this latter one: DEX-1322.
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 in c1cb541. So, currently that means that this table is displaying a ton of rows.
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.
For the first weird thing: You are not technically passing
maxHeight
toIndividualsDisplay
, you are passingstyle
. Neither of those two props are used directly byIndividualsDisplay
. Instead they are destructured into itsrest
property and spread as props toDataDisplay
.DataDisplay
does destructuremaxHeight
, butstyle
is once again destructured into therest
property. ThemaxHeight
prop is used in theTableContainer
'sstyle
, butrest
is spread to thediv
wrapping all ofDataDisplay
's other children. Thatdiv
has the defaultoverflow: visible
, so it may not look likemaxHeight
is working, but it is.When I pass
style={{ maxHeight: 200, border: '1px solid red' }}
toIndividualsDisplay
, it is only 200px tall, but it overflows. Notice that the pagination is right below the 200px tall display:When I pass
maxHeight={200}
toIndividualsDisplay
, the table height is constrained: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.
Maybe instead of adding a
maxHeight
prop toDataDisplay
, we should add atableContainerStyles
prop instead?