I am currently utilizing the DetalisList
component alongside the ScrollablePane
to ensure that the header remains fixed while allowing the rows to scroll. However, I have encountered a challenge as I need to manually specify the height of the scrollable container.
div.scrollable-container
ScrollablePane
DetailsList
Upon inspecting the DOM elements associated with the DetalisList, it appears that it is enclosed within a ViewPort element. The height of this element corresponds to the combined height of all components within the list (such as column headers and rows). Consequently, I aim to accurately determine this value in order to dynamically adjust the container's height based on certain conditions.
Could anyone suggest an efficient method to access the height of the ViewPort without relying on direct manipulation of the internal structure of the component? Although I could resort to traversing the DOM tree to locate the element, I prefer finding a more elegant solution.
Thus far, my search for relevant information has been inconclusive. While I did come across the prop viewport
in the DetailsList
, I suspect it may not serve the purpose I have in mind.