Perspective 8.1.47 - Table filter behavior when first record has a "null" value

Hello, I've encountered some strange behavior with the column filters in the Table component, and I am not sure if it is a known bug or not.

I've found that if the first record in a table has a value that is "null" instead of just empty, the filter popup will not appear when clicking the filter icon.

To demonstrate, I've set the "country" column below to enable and show filter. I set the country on data[0] to "null" (which is valid to show an empty value it seems). You can see I have the filter selected as it's highlighted blue, but there is no popup to select a filter condition.

Then, when I set the country to an empty value rather than null, the filter options pop up immediately.

This does not seem to be the case for any following records. Here I've tried to recreate it with data[1] but the filter works fine.

Now I just need to implement a workaround for this in my application to set a null value to an empty string for the first record. Wasn't sure if this was a known issue so I wanted to bring this to light.

Try setting the render type of your column and see if that helps. When render type is auto, we try to determine what type of filter to display from the value of the for item in the column.

1 Like

That worked :slight_smile: The only downside is the field now shows "null" instead of being empty, which I think we could live with. Thanks

If the null bothers you enough, you can always take steps to replace the null with an empty string. If the data is coming from a database, using the coalesce function in your query is really handy for this.

2 Likes