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

Table feat: maintain sorting when input data changes #273

Open
declann opened this issue Jan 5, 2025 · 2 comments
Open

Table feat: maintain sorting when input data changes #273

declann opened this issue Jan 5, 2025 · 2 comments

Comments

@declann
Copy link

declann commented Jan 5, 2025

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
Copy link
Author

declann commented Jan 20, 2025

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
Copy link
Author

declann commented Jan 22, 2025

Also, the OHQ data table cell supports this

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant