Feature: adding top content option #1355
Open
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.
This PR adds the option to include arbitrary content at the top of the scroll container.
The main use case is pages with long tables and additional content above them, such as a summary. Currently the only way to place the summary above is to limit the height of the table based on the viewport and the content, which can cause various UX issues (e.g double scrollbars from the page and table; tiny tables on short screens; etc.)
This solution is to allow including additional JSX inside
MRT_TableContainer
, and setting its wrapper to be sticky in the horizontal axis so it will not scroll with the table.The only slight complication is that
MRT_TopToolbar
needs to be added separately inside the sticky wrapper instead ofMRT_TablePaper
(this also means adjusting the sticky header'stop
property).