Skip to content
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

feat(archive): Fix virtualized table cannot scroll #1146

Merged
merged 2 commits into from
Jan 8, 2020

Conversation

mxiao6
Copy link
Contributor

@mxiao6 mxiao6 commented Jan 8, 2020

No description provided.

@mxiao6 mxiao6 requested a review from a team as a code owner January 8, 2020 02:40
@boxcla
Copy link

boxcla commented Jan 8, 2020

Verified that @mxiao6 has signed the CLA. Thanks for the pull request!

mickr
mickr previously approved these changes Jan 8, 2020
<AutoSizer disableWidth>
{({ height }) => (
<VirtualizedTable
height={height - 120} // Subtruct SearchBar and Breadcrumbs heights
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The need for this is counterintuitive, since the search bar and breadcrumbs are declared outside of the AutoSizer. Does the AutoSizer calculate its height based on the viewport? Does it still work if there are multiple previews on the same page?

Copy link
Contributor Author

@mxiao6 mxiao6 Jan 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The need for this is counterintuitive, since the search bar and breadcrumbs are declared outside of the AutoSizer. Does the AutoSizer calculate its height based on the viewport? Does it still work if there are multiple previews on the same page?

No it's not based on the viewport. AutoSizer expands to fill its parent but does not work well flex box container. I added a block container and problem solved!

@@ -4,15 +4,16 @@ import elementsMessages from 'box-elements-messages'; // eslint-disable-line
import intlLocaleData from 'react-intl-locale-data'; // eslint-disable-line
import Internationalize from 'box-ui-elements/es/elements/common/Internationalize';
import fuzzySearch from 'box-ui-elements/es/utils/fuzzySearch';
import VirtualizedTable from 'box-ui-elements/es/features/virtualized-table';
import { AutoSizer } from 'react-virtualized';
import { Column, SortDirection } from 'react-virtualized/dist/es/Table/index';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to omit /index here.

@@ -4,15 +4,16 @@ import elementsMessages from 'box-elements-messages'; // eslint-disable-line
import intlLocaleData from 'react-intl-locale-data'; // eslint-disable-line
import Internationalize from 'box-ui-elements/es/elements/common/Internationalize';
import fuzzySearch from 'box-ui-elements/es/utils/fuzzySearch';
import VirtualizedTable from 'box-ui-elements/es/features/virtualized-table';
import { AutoSizer } from 'react-virtualized';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work?

import { AutoSizer, Column, SortDirection } from 'react-virtualized';

/>,
]}
</VirtualizedTable>
<div className="bp-AutoSizerContainer">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a new component, so it should probably be called bp-ArchiveExplorer-table or something.

@mergify mergify bot merged commit ea915b7 into box:master Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants