question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamic height based on parent div

See original GitHub issue

Is your feature request related to a problem? Please describe. I need to be able to dynamically adjust the height of a table based on the parent / context div’s height. It appears as though the hooks exist for dynamic re-sizing vertically (i.e. through the vh capability in the maxBodyHeight prop) and the functionality is already fully implemented for re-sizing horizontally based on a div (i.e. if you have an expandable div in the width dimension, the table resizes accordingly), but it doesn’t currently work in the height dimension when based on the div.

Describe the solution you’d like Adding % functionality to the maxBodyHeight prop, or another way altogether that allows for dynamic height size based on the surrounding div.

Describe alternatives you’ve considered Alternatively (a quicker but less direct solution), if classnames are added to the table’s overflow-x: auto and overflow-y: auto divs, it’s possible to override the CSS styling in such a way that height is resizable.

I noticed that ...props.style was added to the Container but if this was also added to those child divs, this behavior may be attainable, so long as each div is modifiable uniquely.

Additional context There was an issue brought up and addressed a couple weeks ago (#556) regarding ‘%’ handling in the table, and the reply was that it can’t be applied based on the parent component that isn’t specified a height. I still feel as though this is possible since all the hooks appear to be there when resizing based on the viewport (vh) and it already works in terms of the width.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
Cnordbocommented, Sep 4, 2020

Is this fixed somehow? or is there still help wanted?

I think this issue should be left open if its not fixed.

2reactions
abhishekpokhrelcommented, Nov 30, 2020

My fix was to set the bodyheight in vh so that it is relative to every screen device’s height. E.g. maxBodyHeight: “75vh”, minBodyHeight: “75vh”,

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make parent div height dynamic which choose child div?
As far as my understanding of your question, you need you parent div to have height adjust according to your content div.
Read more >
Child Div Expand Height base on dynamic height of Parent Div
Child Div Expand Height base on dynamic height of Parent Div - tip.css.
Read more >
height - CSS: Cascading Style Sheets - MDN Web Docs
The height CSS property specifies the height of an element. By default, the property defines the height of the content area.
Read more >
How to make div height expand with its content using CSS
The height property is used to set the height of an element. The height property does not contains padding, margin and border of...
Read more >
CSS Dynamic Height: Tricks To Improve Your Website's ...
CSS allows you to set the size of any div. And, for that, CSS provides you with the height property. It is not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found