dasDaniel/svelte-table

Column selection not working

Closed this issue · 7 comments

Hi,

in the current version 0.5.6 the column selection has a bug.
You can reproduce it in the example 3 of the repository when trying to show the IPs.
It seems that the table tries to access columns that have been removed from the columns array:
Uncaught (in promise) TypeError: Cannot convert undefined or null to object

In my table I get a similiar error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'searchValue')

image

Thanks for reporting.

This is an issue in the example itself and not the library. I've made the fix (in the develop branch). I won't be publishing a separate version for this fix though, so it won't make it out until there's a change to the library itself.

The error Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'searchValue') seems to indicate that the the lib cannot find the object in the column.
Can you provide an example/repl for the error you are seeing?

Hi dasDaniel,

Thanks for the fast response! It seems the errors were unrelated then.
My issue seems to be connected to the filteringOptions. I set up a REPL that can reproduce it:
https://svelte.dev/repl/753aa7ce0d0c49d2942bdc08010b141f?version=3.57.0

As soon as a column with the filteringOptions is removed, the table crashed with the above error.

Thanks, I see the issue.
I think this is related to a combination of filters and columns being removed, which Example3 doesn't cover. I will need to figure out a solution for this.

Awesome, thanks for the reponse. Looking forward to a fix!

fixed in v0.5.7

Awesome work, thanks for the fast fix!