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

Simple repro of height bug when trying to get a <regular-table> to participate in a flex layout #124

Open
telamonian opened this issue Mar 30, 2021 · 1 comment
Labels
question Questions about use, potential features, or improvements

Comments

@telamonian
Copy link
Contributor

telamonian commented Mar 30, 2021

The repro

I came up with a simple repro of the issue I was having in #115:

https://bl.ocks.org/telamonian/00c777c2194e11f43bd7ade294095aa1

The "bug"

The <regular-table> element renders as zero height.

Description

In the above example, there's an #outer flex box that contains two children:

  • a simple <span> with some text content
  • a <regular-table> with ~15,000 data rows

In order to get a <regular-table> element to participate in a flex layout, you have to change it's position (or wrap it in a <div> and change the position of that) to something other than absolute (I think maybe it has to be position: relative, not 100% sure). As soon as you change position, though, the <regular-table> disappears. The only resolution seems to be to set an explicit height in px on at least one of the parent elements of the <regular-table>. In theory, the height of the <regular-table> should be taken care of by the flex layout.

Is this a bug or not? If it is a bug, how do we fix it?

My sense is that there's a tweak to some virtual size calculation somewhere in scroll_body.js that will allow for height to be controlled by the flex layout

@telamonian telamonian added the question Questions about use, potential features, or improvements label Mar 30, 2021
@domehead100
Copy link

This is old, but if you add flex-grow: 1 to the regular-table in addition to position: relative, then it should fill the remaining height in the flex container.

Like most table/grid components, it’s mostly up to you to size/constrain the table/viewport size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions about use, potential features, or improvements
Projects
None yet
Development

No branches or pull requests

2 participants