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
observeChangesplugin is no longer enabled bycolumnSortingand 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 aspopulateFromArrayorsetDataAtCell. - The
modifyRow,modifyCol,unmodifyRow,unmodifyColandskipLengthCachehooks are no longer needed and were removed. - The
manualColumnFreezeplugin doesn’t use themanualColumnMoveplugin anymore. - The
collapsibleColumnsplugin doesn’t use thehiddenColumnsplugin anymore. - The
nestedRowsplugin doesn’t use thetrimRowsplugin anymore. - The
filtersplugin doesn’t use thetrimRowsplugin anymore. - The
minSpareRowsandminRowsoptions will ensure that the number of visible rows corresponds to the value provided to them (for example, thetrimRowsplugin 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
afterLoadDatahook receives a different set of arguments. It used to be just theinitialLoadflag, now the first argument issourceData, followed byinitialLoad. - The
manualColumnFreezeplugin will now put the unfrozen columns right next to the last frozen one. - The
RecordTranslatorobject 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
nestedRowsplugin is enabled, moving rows will be possible only using the UI or by calling thedragRowsmethod of themanualRowMoveplugin. For more in-depth information about these changes, see the description of pull request #5945 (#5751).
- The
- The
beforeRowResize,afterRowResize,beforeColumnResize,afterColumnResizehooks 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 aniframeor some other content-trimming context. (#6283, #6417) - We also added a
uiContaineroption 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
columnSortingoption enabled. (#2685) - Fixed a problem with
loadDatanot resetting the row order changed by themanualRowMoveplugin. (#3568) - Fixed a bug, where using
alter‘sinsert_rowafter using theloadDatamethod 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
loadDataalong with theminSpareRowsoption. (#3937) - Fixed a problem with the
columnSummaryplugin not working properly after adding new rows using the Context Menu and sorting the data. (#3924) - Fixed a bug, where calling
loadDatawith 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
filtersplugin 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
afterRowMovehook receiving an impropertargetargument. (#4501) - Fixed a problem with the
manualColumnFreezeplugin enablingmanualColumnMove, even if it was declared asfalse. (#4553) - Fixed a problem with plugins using
arrayMappersnot working properly after updating the dataset. (#4567) - Fixed a bug, where calling
loadDatawithminSpareRowsandmanualRowMoveenabled caused the table to improperly load the data. (#4576) - Fixed a bug, where enabling
columnSortingcaused themanualColumnFreezeto 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
persistentStatewas enabled. (#4713) - Fixed a bug, where
manualColumnMovedidn’t work if the dataset was empty. (#4926) - Fixed a bug with the
collapseAllmethod from thecollapsibleColumnsplugin did not work properly ifcolumnSortingwas enabled. (#4999) - Created a shared row mapper for the
columnSorting,manualRowMove, andtrimRowsplugins. (#5065) - Refactored the
manualRowMoveplugin to match the new architecture. (#5068) - Fixed a bug, where calling
loadDatawithminSpareRowsenabled would cause unwanted blank rows to appear. (#5707) - Fixed a bug with the
afterColumnMovehook received improper target argument. (#5173) - Fixed a problem, where filtering data after moving rows would not work properly. (#5178)
- Fixed a bug, where calling
loadDatamadeNaNappear in the column headers (#5369). - Fixed a bug with the
skipColumnOnPasteoption not working properly when usingcolumnSortingandhiddenColumns. (#5824) - Fixed a bug with the
trimRowsplugin which did not work properly after moving rows. (#5860) - Fixed a problem with
minSpareRowsnot working properly with thetrimRowsplugin enabled. (#5862) - Fixed a problem, where it was impossible to filter the data declared in the
nestedRowsplugin. (#5889) - Fixed a bug, where filtering and sorting data would cause the
toVisualRowmethod to return the wrong results. (#5890) - Fixed a bug with the
filtersandtrimRowsplugins not working properly alongside each other (#5915). - Fixed a bug, where
manualColumnMovewould not work properly when the data object properties count would be lower than the table column count. (#5931) - Fixed a bug with the
trimRowsplugin did not work properly with thestartRowsoption. (#5953) - Fixed a problem, where using
loadDataafter sorting would not work as expected. (#5956) - Fixed a problem with the
beforeColumnMoveandafterColumnMovehooks missing information about their destination indexes. (#6005) - Fixed a problem where using filters and
minSpareRowswould make the table add an empty row at the beginning of the table. (#6278) - Fixed a bug with the
manualRowMoveplugin 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
toVisualRowmethod returned null when using thetrimRowsand columnSorting plugins together. (#6310) - Fixed a problem, where calling updateSettings in the
afterColumnMovehook callback would have no effect. (#4480) - Fixed a bug, where calling
loadDatawould make the filters plugin not to behave as expected. (#5244) - Fixed a bug, where detaching a child from a parent in the
nestedRowsplugin would cause a+/-button misalignment. (#5900) - Fixed a problem with the
columnSummaryplugin creating a doubled summary row. (#5794) - Fixed a bug, where moving children between parents using the
nestedRowsplugin would throw an error. (#6066) - Fixed a bug, where adding rows by modifying the data by reference while using the
nestedRowsplugin would throw an error. (#3914) - Fixed a bug, where merging cells would conflict with the
columnSortingplugin. (#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
puppeteerpackage in thedevDependenciessection to get rid of thenpm auditsecurity 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)