For cell types Numeric, Date or Time, at least, my table correctly starts life with value null
in the cell, which displays as “empty”. If the user edits the cell but does not type anything, the cell’s value is updated to the empty string.
While this seems OK initially, other things can later go wrong, e.g. formula calculation, server-side processing, etc., because the value is now of the wrong type. As your documentation correctly states, for example:
Make sure your cell values are numbers and not strings as Handsontable will not parse strings to numbers.
These cell types should recognise setting to empty string and convert the ""
value to null
. This is applicable not only after editing a cell but also, for example, after pasting a value imported from Excel.
For now I have written a beforeChange
hook to walk the changes[]
array and alter it in-place in this situation, but may I suggest that Hot should do this automatically somewhere in its own code, possibly even before validation.