inputs icon indicating copy to clipboard operation
inputs copied to clipboard

Table feat: maintain sorting when input data changes

Open declann opened this issue 1 year ago • 2 comments

Lately I did some accounts in a Framework notebook.

I was in a loop of categorising my data and then reviewing it in a few Inputs.tables and my big takeaway was that I can't really use Inputs.table (In Framework or Observable Notebooks) in such a loop (hot loop: many many repeats) for one reason: It resets the view (especially sort config) every time inputs change. Otherwise I liked this experience!

You can see the issue if you edit the cell for penguins here, after setting a sort in the table - even if you only add a comment to the penguins cell: https://observablehq.com/@observablehq/input-table

Maybe I need to make a different custom table since the solution here would change the implementation of Inputs.table a lot - I guess - but putting here in case it is simpler or desirable!

declann avatar Jan 05 '25 21:01 declann

For reference, the Mosaic table component maintains sorting state whenever selected rows change. The Olympic Athletes dashboard is an example where you can test this.

declann avatar Jan 20 '25 09:01 declann

Also, the OHQ data table cell supports this

It's also probably better for my usecase if it gets ported to Framework

declann avatar Jan 22 '25 15:01 declann