Handsontable 8.0.0-beta.1 released
We are excited to announce that Handsontable 8.0.0-beta.1 has just been released. This version is focused mainly on a new row and column management that resolved the issues with imperfect calculation between physical and visual indexes. We are working on a stable 8.0.0 version along with a migration guide to provide a seamless upgrade experience.
Breaking changes
- In order to fix recurring issues with plugins we implemented a new architecture for row and column management. The new approach offers an easier and more straightforward way to perform CRUD and move operations on rows and columns. The refactor is global and affected several parts of the library therefore resulting in the following breaking changes:
- The
observeChanges
plugin is no longer enabled bycolumnSorting
and became deprecated. - Modifying the table’s data by reference and calling
render()
will not work as it used to anymore. From this point onward, all the data-related operations need to be performed using the API methods, such aspopulateFromArray
orsetDataAtCell
. - The
modifyRow
,modifyCol
,unmodifyRow
,unmodifyCol
andskipLengthCache
hooks are no longer needed and were removed. - The
manualColumnFreeze
plugin doesn’t use themanualColumnMove
plugin anymore. - The
collapsibleColumns
plugin doesn’t use thehiddenColumns
plugin anymore. - The
nestedRows
plugin doesn’t use thetrimRows
plugin anymore. - The
filters
plugin doesn’t use thetrimRows
plugin anymore. - The
minSpareRows
andminRows
options will ensure that the number of visible rows corresponds to the value provided to them (for example, thetrimRows
plugin won’t have an impact on the number of displayed rows). - Methods like
toPhysicalRow
,toVisualColumn
, etc. now return null for non-existent rows/columns. - The
afterLoadData
hook receives a different set of arguments. It used to be just theinitialLoad
flag, now the first argument issourceData
, followed byinitialLoad
. - The
manualColumnFreeze
plugin will now put the unfrozen columns right next to the last frozen one. - The
RecordTranslator
object and the t property available in the plugins were removed. - after-prefixed hooks (
afterLoadData
,afterFilter
, etc.) are now called just before the render call. - Newly created rows and columns are now placed in the source data in the place calculated from its position in the visual context (they “stick” to their adjacent rows/columns).
- When the
nestedRows
plugin is enabled, moving rows will be possible only using the UI or by calling thedragRows
method of themanualRowMove
plugin. For more in-depth information about these changes, see the description of pull request #5945 (#5751).
- The
- The
beforeRowResize
,afterRowResize
,beforeColumnResize
,afterColumnResize
hooks have the order of their arguments rearranged for the sake of consistency with other hooks (#3328). It was:(currentIndex: number, newSize: number, isDoubleClick: boolean)
. It changed to:(newSize: number, index: number, isDoubleClick: boolean).
- Change the argument structure in
collapsibleColumns
‘ toggleCollapsibleSection method. It was:(coords: object, action: string)
, now it is:(coords: Array<object>, action: string).
New features (also present in the upcoming version 7.3.0)
- We’re introducing a new option to the Context Menu plugin –
uiContainer
. It allows declaring a DOM container, where all the Context Menu’s element will be placed. It may come espacially handy when using Handsontable inside of aniframe
or some other content-trimming context. (#6283, #6417) - We also added a
uiContainer
option to the Copy/Paste plugin. It works in a similar way to the one described above, but is used to declare the container for the Copy/Paste plugin’s DOM elements. (#6343)
Changes
- Resolved a problem with data not being added to the table properly with the
columnSorting
option enabled. (#2685) - Fixed a problem with
loadData
not resetting the row order changed by themanualRowMove
plugin. (#3568) - Fixed a bug, where using
alter
‘sinsert_row
after using theloadData
method and sorting the data would add unintentional additional rows to the table. (#3809) - Fixed a bug, where blank rows appeared in the middle of the table after using
loadData
along with theminSpareRows
option. (#3937) - Fixed a problem with the
columnSummary
plugin not working properly after adding new rows using the Context Menu and sorting the data. (#3924) - Fixed a bug, where calling
loadData
with an object-based data source would not work properly. (#4204) - Fixed a problem with the Hidden Columns settings being reset after calling
updateSettings
. (#4121) - Fixed a bug with the
filters
plugin using incorrect indexes after moving and/or sorting the table. (#4442) - Fixed a bug that caused a column to contain improper data after moving it to index
0
. (#4470) - Fixed a bug with the
afterRowMove
hook receiving an impropertarget
argument. (#4501) - Fixed a problem with the
manualColumnFreeze
plugin enablingmanualColumnMove
, even if it was declared asfalse
. (#4553) - Fixed a problem with plugins using
arrayMappers
not working properly after updating the dataset. (#4567) - Fixed a bug, where calling
loadData
withminSpareRows
andmanualRowMove
enabled caused the table to improperly load the data. (#4576) - Fixed a bug, where enabling
columnSorting
caused themanualColumnFreeze
to be unusable. (#4601) - Fixed a problem, where the columns were assigned improper widths after inserting additional columns or removing any of them. (#4666)
- Fixed a bug, where moving rows was impossible while
persistentState
was enabled. (#4713) - Fixed a bug, where
manualColumnMove
didn’t work if the dataset was empty. (#4926) - Fixed a bug with the
collapseAll
method from thecollapsibleColumns
plugin did not work properly ifcolumnSorting
was enabled. (#4999) - Created a shared row mapper for the
columnSorting
,manualRowMove
, andtrimRows
plugins. (#5065) - Refactored the
manualRowMove
plugin to match the new architecture. (#5068) - Fixed a bug, where calling
loadData
withminSpareRows
enabled would cause unwanted blank rows to appear. (#5707) - Fixed a bug with the
afterColumnMove
hook received improper target argument. (#5173) - Fixed a problem, where filtering data after moving rows would not work properly. (#5178)
- Fixed a bug, where calling
loadData
madeNaN
appear in the column headers (#5369). - Fixed a bug with the
skipColumnOnPaste
option not working properly when usingcolumnSorting
andhiddenColumns
. (#5824) - Fixed a bug with the
trimRows
plugin which did not work properly after moving rows. (#5860) - Fixed a problem with
minSpareRows
not working properly with thetrimRows
plugin enabled. (#5862) - Fixed a problem, where it was impossible to filter the data declared in the
nestedRows
plugin. (#5889) - Fixed a bug, where filtering and sorting data would cause the
toVisualRow
method to return the wrong results. (#5890) - Fixed a bug with the
filters
andtrimRows
plugins not working properly alongside each other (#5915). - Fixed a bug, where
manualColumnMove
would not work properly when the data object properties count would be lower than the table column count. (#5931) - Fixed a bug with the
trimRows
plugin did not work properly with thestartRows
option. (#5953) - Fixed a problem, where using
loadData
after sorting would not work as expected. (#5956) - Fixed a problem with the
beforeColumnMove
andafterColumnMove
hooks missing information about their destination indexes. (#6005) - Fixed a problem where using filters and
minSpareRows
would make the table add an empty row at the beginning of the table. (#6278) - Fixed a bug with the
manualRowMove
plugin that would duplicate data in the moved rows if used with a row index greater than the table row count. (#6088) - Fixed a bug, where the
toVisualRow
method returned null when using thetrimRows
and columnSorting plugins together. (#6310) - Fixed a problem, where calling updateSettings in the
afterColumnMove
hook callback would have no effect. (#4480) - Fixed a bug, where calling
loadData
would make the filters plugin not to behave as expected. (#5244) - Fixed a bug, where detaching a child from a parent in the
nestedRows
plugin would cause a+/-
button misalignment. (#5900) - Fixed a problem with the
columnSummary
plugin creating a doubled summary row. (#5794) - Fixed a bug, where moving children between parents using the
nestedRows
plugin would throw an error. (#6066) - Fixed a bug, where adding rows by modifying the data by reference while using the
nestedRows
plugin would throw an error. (#3914) - Fixed a bug, where merging cells would conflict with the
columnSorting
plugin. (#6086) - Fixed a bug, where the row headers would stay visible after removing all the table columns. (#6412)
The release includes changes from the upcoming 7.3.0 version:
- Fixed a problem with table resizing on every scroll event on Firefox, when no table height was defined. (#6344)
- Updated the
puppeteer
package in thedevDependencies
section to get rid of thenpm audit
security error. (#6393) - Removed the unneeded
CNAME_
file from the repo. (#6389) - Fixed a problem, where pasting data from Excel caused Handsontable to throw an error. (#6217)
- Fixed a bug, where data pasted from Excel would get improperly formatted in Handsontable. (#6258)
- Fixed a bug, where the
& < > ' "
characters in the pasted data would be automatically changed to their equivalent HTML entities. (#1535)