fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Make ScrollablePane work with only maxHeight from parent element

Open artxach opened this issue 7 years ago • 6 comments

Environment Information

  • Package version(s): 5.131.0
  • Browser and OS versions: Windows 10, Edge

Please provide a reproduction of the bug in a codepen:

Actual behavior:

<div id='myGeneralContainer'>
 <div style={{position:'relative', maxHeight:'300px'}>
   <ScrollablePane>
      <DetailsList .../>
   </ScrollablePane>
 </div>
<div>

The details list is not rendered, and actual height of scrollable pane is 0. Nothing is rendered.

Expected behavior:

The details list should take its content height automatically, and if it exceeds 300px only then the scrollbars should appear.

Priorities and help requested:

Are you willing to submit a PR to fix? (Yes, No)

Requested priority: High

Products/sites affected: (if applicable)

artxach avatar Feb 06 '19 12:02 artxach

You're actually describing the intended behavior of the ScrollablePane itself. Rather than taking the height of the content and using that to decide the height. It uses the height of the parent to determine the height (using the position:absolute;top:0;left:0;right:0;bottom:0 trick). I've made a really simplified version of this scrollable pane and what it actually uses for styling:

https://codepen.io/anon/pen/JxOYZj

This is actually by design. In your scenario, probably best is to use a min-height or specify a height to "reserve" space for ScrollablePane to do its job.

Feel free to fork and modify that codepen to describe what you are expecting. Thanks!

kenotron avatar Feb 06 '19 17:02 kenotron

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your contributions to Fabric React!

msft-github-bot avatar Feb 10 '19 18:02 msft-github-bot

hi @kenotron . Thanks for the response. I understand the styling of ScrollablePane. In my case, i don't know the height, and if i specify min-height, the scrollablepane will always take min-height and will not expand to its actual height. Even in your example of codepen, the content is NOT VISIBLE and the height of ScrollablePane is 0. image

artxach avatar Feb 12 '19 08:02 artxach

I'm going to punt this to feature request at this point.

kenotron avatar Feb 16 '19 01:02 kenotron

hi. any updates on this?

artxach avatar Mar 29 '19 10:03 artxach

Given this is the intended behavior and we don't have current plans to make updates to ScrollablePane I'm going to close this out. If others hit this issue and have more data on why this should get fixed, please feel free to reopen or add additional details

JustSlone avatar Jan 02 '21 23:01 JustSlone