updateSettings() wipes Filters conditionCollection

Hello all,

we are using Handsontable in a React app and currently upgrading it from 15.3.0 to 17.0.1 and encounter an issue that seems to have been introduced in 16.2.0, affecting the filters plugin.

While working on a table where users can filter rows and edit cell values, on a filtered table, editing a cell will make any active filter be wiped and all the rows to reappear.

Calling updateSettings() while the Filters plugin has active conditions destroys the conditionCollection. Any filter applied by the user is silently wiped. In a React app this surfaces whenever a data refresh causes the component to re-render and pass new props to the table, since the react-wrapper calls updateSettings() on every prop change.


Steps to reproduce

Fiddle: HOT 16.2: updateSettings() wipes Filters conditionCollection - JSFiddle - Code Playground

  1. Apply a filter on any column
  2. Change the cell value in the last column
  3. Filtered table is gone, all rows reappear

This does not happen if we change the version to 16.1.1 (also testable in the Fiddle).

This is blocking us from upgrading. Is this a known issue? And is a fix planned for an upcoming release?

Thank you.

Hi @jonas.witt

This behavior is intended for the updateSettings() > data to rerender the view (previously, it was not working well). To update data while preserving filtering state, please use updateData() instead.

Here’s the update demo: HOT 16.2: updateSettings() wipes Filters conditionCollection - JSFiddle - Code Playground

More on updateData() Core methods API reference - Angular Data Grid | Handsontable

Please let me know if it meets your requirements.

1 Like