The hook `persistentStateSave` is called even when the option `persistentState` is set to false

Tags: #<Tag:0x00007efc610904e8>

Hello, Handsontable team,

According to the doc, the hook persistentStateSave is only exposed when the option persistentState is set true. However, it is still called when the column is manually moved even when the persistentState is set false.

It doesn’t check whether the persistentState is set to false.

Please check this fiddle: https://jsfiddle.net/guobacai/46gcnaLz/22/

Also, when calling the moveColumns/moveColumn, the hook persistentStateSave is not called even when the persistentState is set true. I am not sure if this is by design.

Hi @lijigang.us

Thank you for sharing your insights. /the hook itself is called but nothing gets stored in the localStorage. We should update the description in the documentation. The same happens for the persistentStateLoad.

I have reported the alteration need in our main repository https://github.com/handsontable/handsontable/issues/8638

Hi @aleksandra_budnik

Thanks for the quick response.

I guess this problem could be here: https://github.com/handsontable/handsontable/blob/b0a09bde9a9d4164bee4f28cd047fa843f42a7a9/src/plugins/manualColumnMove/manualColumnMove.js#L337

Even when the persistentState is set to false, it will still calls the hook ‘persistentStateLoad’ .
As you said, since there is nothing in the localStorage, so no column is moved.

However, according to the doc, the hook persistentStateLoad is not even supposed to be called.

So, the doc is a little confusing.

That is true. That is why I have asked the team not to improve the description.

I’m closing this issue as done. Thank you for the feedback @lijigang.us one again.