trimRows works incorrectly

Tags: #<Tag:0x00007efc6ddfa8e8>

Hello guys,

I have a really nasty issue with hiding and showing some rows in handsontable.
So very simplified scenario that I need to hide and show rows based on some business conditions.

I’m using trimRows and untrimRows for that, overall it works great, until column sorting is turned off.
If it is tunred on, than after untrim / trim method calls and re-render of grid, empty rows appears in the grid.

Please see Fiddle: Fiddle
just hit submit button and notice that a lot of empty rows appeared (or just not removed)

But as mentioned before, if I remove sorting all works great: Fiddle

The only thing that helps from those empty rows appearance, is calling updateSettings method, but then sorting is being reset. Fiddle

Did someone faced similar issues or I just missing something?

Thanks a lot,
Alex

It’s the first time I see this behavior. Thanks for sharing @aleksejs.piscevs this is definitely a bug.

There is one ugly workaround for this - put slight timeout between trim and untrim with additional render Fiddle.

But it would be great if there is any other more elegant workaround or fix.

Aleksandra, is there any option how can I track if this issue will be ever resolved?

Yes, sure it is. I just added the following issue to our internal ticketing system.
When the issue will get fixed I will leave you a note.

It looks like the issue is no longer replicable. Please update the version of Handsontable.