day8 / re-com

A ClojureScript library of reusable components for Reagent
https://re-com.day8.com.au
MIT License
796 stars 147 forks source link

Add :min-rows arg to simple-v-table #260

Open Gregg8 opened 3 years ago

Gregg8 commented 3 years ago

As per the docs, by default, simple-v-table is vertically polite. In other words, it only takes up as much vertical space as it's parents and siblings allow.

We have a way to make it even less greedy via the :max-rows argument, so that when the model reaches a certain number of rows, it stop taking up any more height and relies on its own vertical scrollbar.

Because if this politeness, we sometimes get the situation where you only see the top header section with zero rows underneath, even though there are plenty to show. It looks like a bug.

So let's look at being greedy. Currently, we have two options:

Therefore, it would be very useful to have a :min-rows partner arg to :max-rows. The default could be set to 1.

Ideally this would be an intelligent minimum, such that if you had it set to say five, but there were only two rows in the model, it would only take up the vertical space for two rows.