observablehq / inputs

Better input elements
https://observablehq.com/framework/lib/inputs
ISC License
125 stars 34 forks source link

Table input doesn't page through data when only `height` is set. #261

Closed simond closed 6 months ago

simond commented 6 months ago

I have a simple Framework page that contains some sample data (over 10,000 records) and a table. When setting the height of the table to any value the table does not scroll through the full results of the data, it simply scrolls to the end of the first set of rows

Markdown:

# Sample
```js
const d = FileAttachment("./data/sample.csv").csv({typed: true});

Table of data:

Inputs.table(d, {
    height: 400
})

If I change the table to include the number of rows to display the scrolling works as expected:
Inputs.table(d, {
    rows: 18, 
    height: 400
})
Fil commented 6 months ago

Confirmed with

Inputs.table(aapl, {height: 400}) // doesn't scroll

using rows: 10 does NOT fix it

Inputs.table(aapl, {height: 400, rows: 10}) // doesn't scroll

Using rows: 18 does fix it (like you say).

Inputs.table(aapl, {height: 400, rows: 18}) // OK
Fil commented 6 months ago

The bug also happens in notebooks. I'll transfer it to the Inputs repo if that's OK with you

simond commented 6 months ago

The bug also happens in notebooks. I'll transfer it to the Inputs repo if that's OK with you

Sounds good to me!

mootari commented 6 months ago

Duplicate of #248