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

Feature/issue 1063 responsive options and table height #1134

Merged

Conversation

gabrielliwerant
Copy link
Collaborator

@gabrielliwerant gabrielliwerant commented Jan 4, 2020

Closes #1075, #1063 and continues by adding two new options for responsive cases:

  • scrollFullHeightFullWidth
  • stackedFullWidth

Both use absolute position on the paper container element to allow window width to be surrounded by the container to fix visual breakage with overflowing widths, but also allow fixed header options to operate.

Height was decoupled in the code, but not created as a separate option as height will only be supported by certain responsive modes, which is likely to create confusion. Overriding styles allows altering height values, so this functionality exists regardless, but the decoupling will make it easier to modify the API in the future if there's a good way to do so.

Allows some flexibility in case height becomes a separate option
Allows fixed header to operate as well as fix issues where the width of the table overflows the browser window
Mirrors the responsive scroll full width option to allow fixed header to behave properly
@coveralls
Copy link

coveralls commented Jan 4, 2020

Coverage Status

Coverage decreased (-0.6%) to 75.868% when pulling 2b113b6 on feature/issue-1063-responsive-options-and-table-height into 12b2d2b on master.

…o feature/issue-1063-responsive-options-and-table-height

# Conflicts:
#	src/MUIDataTable.js
@gabrielliwerant gabrielliwerant merged commit 8df7acf into master Jan 17, 2020
@gabrielliwerant gabrielliwerant deleted the feature/issue-1063-responsive-options-and-table-height branch January 17, 2020 07:20
@maxkarkowski
Copy link

maxkarkowski commented Feb 5, 2020

seem like that it is still an issue that scrollFullHeight has no overflow.
setting: responsive: 'scrollFullHeight' as any,
<div className="vpp-order-list" data-testid="vppTable"> <MUIDataTable title={<Title onRefresh={handleRefresh} />} data={rows} columns={TableColumns} options={TableSettings} ></MUIDataTable> </div>
overflow

using mui-datatables@^2.14.0

@gabrielliwerant
Copy link
Collaborator Author

gabrielliwerant commented Feb 5, 2020

@maxkarkowski If you have an overflowing width, then you'd probably want to use scrollFullHeightFullWidth. The reason there's a new option for that instead of modifying the old one is that they don't quite work the same way, so they will lead to different appearances in different situations, and scrollFullHeight might be the best option for someone who doesn't have width issues because the table is small (hence, it makes sense to have both).

@maxkarkowski
Copy link

@gabrielliwerant thanks for the hint. i tried scrollFullHeightFullWidth but came across another issue as described here. #1075 (comment)

so both settings won't really fit for large tables

@gabrielliwerant
Copy link
Collaborator Author

@maxkarkowski The table is not guaranteed to display properly on the inside of a grid. The responsive options assume that the table is directly affected by the window dimensions. This may be something you have to experiment with by overriding styles on your end.

@AndrewBenzSW
Copy link

I'm curious why the hard coded 499px for scrollMaxHeight moved from the style to the element itself. We'd overridden the style value to good success but when we upgraded to the newest version, the override no longer worked since styled on the element is more specific than class styles, so the override no longer worked.

I was able to work around it by override with "!important" so it's not a huge deal. I just feel icky using that :P

Thanks!

patorjk pushed a commit to patorjk/mui-datatables that referenced this pull request May 31, 2020
* Decouple height from responsive options

Allows some flexibility in case height becomes a separate option

* Add full width responsive scroll option

Allows fixed header to operate as well as fix issues where the width of the table overflows the browser window

* Add responsive stacked full width option

Mirrors the responsive scroll full width option to allow fixed header to behave properly

* Update documentation for new responsive options
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