Skip to content

Migrate from Handsontable 11.1 to Handsontable 12.0, released on April 28, 2022.

More information about this release can be found in the 12.0.0 release blog post.
For a detailed list of changes in this release, see the Changelog.

  1. Verify your updateSettings() calls

    Handsontable 12.0.0 changes how the updateSettings() method handles your grid’s data.

    Each updateSettings() call with the data option defined:

    BeforeAfter
    Replaces dataReplaces data
    Triggers the same hooks as loadData()Triggers the same hooks as updateData()
    Resets configuration options to the initial stateDoesn’t reset configuration options to the initial state
    Resets index mapper informationDoesn’t reset index mapper information

    Migrating to Handsontable 12.0

  2. Adjust to the updatePlugin() changes

    Handsontable 12.0.0 changes how the updatePlugin() method reacts to updateSettings() calls.

    This change might affect your custom plugins.

    Before

    Every updateSettings() call (even with an empty object passed as new settings) triggered the updatePlugin() method for each enabled plugin.

    As a result, whenever you called updateSettings(), all enabled plugins got updated.

    After

    A plugin’s updatePlugin() method gets triggered only when the object passed to updateSettings() contains at least one of the following:

    • The plugin’s PLUGIN_KEY (the plugin’s main alias)
    • An entry from the plugin’s SETTING_KEYS (a property that stores all additional settings relevant to the plugin)

    As a result, a plugin gets updated only if you update settings related to that particular plugin.

    Migrating to Handsontable 12.0

    If you want your custom plugin to still get updated on every updateSettings() call, set your plugin’s SETTING_KEYS to true:

    static get SETTING_KEYS() {
    return true;
    }

    However, in most cases, it’s better to provide an explicit list of configuration options that your custom plugin observes. For details, see the Plugins guide.

  3. Adjust to the afterDocumentKeyDown changes

    Handsontable 12.0.0 changes how the afterDocumentKeyDown hook works.

    Before

    When you used a keyboard to navigate an internal Handsontable instance (e.g., a context menu), the afterDocumentKeyDown hook got fired on every key press.

    afterDocumentKeyDown() {
    // when you navigate the grid, the console message gets logged on
    // every key press
    // when you navigate the context menu, the console message also gets
    // logged on every key press
    console.log('key pressed');
    }

    After

    When you use a keyboard to navigate some internal instances of Handsontable (e.g., a context menu), the afterDocumentKeyDown hook may not get fired anymore.

    afterDocumentKeyDown() {
    // when you navigate the grid, the console message gets logged on
    // every key press
    // when you navigate the context menu, the console message doesn't
    // get logged at all
    console.log('key pressed');
    }

    This change may affect the following areas of Handsontable:

    Migrating to Handsontable 12.0

    You can’t change this behavior by using any of Handsontable’s APIs.

  4. Adjust to the default keyboard shortcuts changes

    Handsontable 12.0 introduces a new keyboard shortcuts API, ShortcutManager.

    ShortcutManager lets you easily manage your custom keyboard shortcuts, but also changes how Handsontable defines its default keyboard shortcuts. Now, nearly all default keyboard shortcuts are defined explicitly.

    We took this opportunity to improve the behavior of Handsontable’s default keyboard shortcuts, so they:

    • Better match their counterparts in popular spreadsheet software
    • Improve the consistency of keyboard navigation
    • Create a more intuitive user experience

    Ctrl vs Cmd

    Handsontable 12.0 splits a cross-platform modifier key (Ctrl/Cmd) into two separate keys. Now, the Cmd key triggers actions on macOS where the Ctrl key triggers actions on Windows.

    For example, the table below shows how this change affects the Ctrl/Cmd+A shortcut:

    BeforeAfter
    WindowsCtrl+A works
    Cmd+A works
    Only Ctrl+A works
    macOSCtrl+A works
    Cmd+A works
    Only Cmd+A works

    Keyboard shortcuts changes: Navigation

    The table below summarizes default keyboard shortcuts changes related to navigation:

    WindowsmacOSBeforeAfter
    Ctrl+Cmd+Extend the selection by one cell upMove to the first cell of the current column
    Ctrl+Cmd+Extend the selection by one cell downMove to the last cell of the current column
    Ctrl+Cmd+Extend the selection by one cell to the leftMove to the leftmost cell of the current row
    Ctrl+Cmd+Extend the selection by one cell to the rightMove to the rightmost cell of the current row
    HomeHomeMove to the first cell of the current rowMove to the first non-frozen cell of the current row*
    Ctrl+HomeCmd+HomeMove to the first cell of the current columnMove to the first non-frozen cell of the grid*
    EndEndMove to the last cell of the current rowMove to the last non-frozen cell of the current row*
    Ctrl+EndCmd+EndMove to the last cell of the current columnMove to the last non-frozen cell of the grid*

    * This action depends on your layout direction.

    Keyboard shortcuts changes: Selection

    The table below summarizes default keyboard shortcuts changes related to selection:

    WindowsmacOSBeforeAfter
    Ctrl+Shift+Cmd+Shift+Extend the selection by one cell upExtend the selection to the first cell of the current column**
    Ctrl+Shift+Cmd+Shift+Extend the selection by one cell downExtend the selection to the last cell of the current column**
    Ctrl+Shift+Cmd+Shift+Extend the selection by one cell to the leftExtend the selection to the leftmost cell of the current row**
    Ctrl+Shift+Cmd+Shift+Extend the selection by one cell to the rightExtend the selection to the rightmost cell of the current row**
    Ctrl+Shift+HomeCmd+Shift+HomeExtend the selection to the first cell of the current columnDoesn’t work anymore (replaced by Ctrl/Cmd+Shift+)
    Ctrl+Shift+EndCmd+Shift+EndExtend the selection to the last cell of the current columnDoesn’t work anymore (replaced by Ctrl/Cmd+Shift+)
    Shift+Page UpShift+Page UpMove one screen upExtend the selection by one screen up
    Shift+Page DownShift+Page DownMove one screen downExtend the selection by one screen down
    Ctrl+EnterCmd+EnterEnter the editing mode of the active cellFill the selected range of cells with the value of the active cell

    ** In case of multiple selection layers, only the last selection layer gets extended.

    Keyboard shortcuts changes: Edition

    The table below summarizes default keyboard shortcuts changes related to edition:

    WindowsmacOSBeforeAfter
    HomeHomeNative browser behavior for the entire windowMove the cursor to the beginning of the text*
    EndEndNative browser behavior for the entire windowMove the cursor to the end of the text*
    Ctrl+ZCmd+ZUndo the last actionUndo the last action in the cell editor
    Ctrl+Shift+ZCmd+Shift+ZRedo the last actionRedo the last action in the cell editor
    Shift+Page UpShift+Page UpMove one screen upDoesn’t work when editing a cell
    Shift+Page DownShift+Page DownMove one screen downDoesn’t work when editing a cell

    * This action depends on your layout direction.

    Keyboard shortcuts changes: Cell merging

    The table below summarizes default keyboard shortcuts changes related to cell merging:

    BeforeAfter
    WindowsCtrl+M works Cmd+M worksOnly Ctrl+M works
    macOSCtrl+M works Cmd+M worksOnly Ctrl+M works
    (Cmd+M conflicted with macOS’s shortcut for window minimizing)

    Migrating to Handsontable 12.0

    To keep the previous (pre-12.0) behavior of a default keyboard shortcut, use the new ShortcutManager API to:

  5. Avoid referring to _wt

    Handsontable 12.0.0 makes it clear that Handsontable’s rendering engine (_wt, internally referred to as “Walkontable”) is not a part of Handsontable’s public API.

    To emphasize this, we changed the following property name:

    BeforeAfter
    handsontableInstance.view.wthandsontableInstance.view._wt

    Migrating to Handsontable 12.0

    _wt has no public documentation and offers no guarantee against breaking changes.

    If you use a private implementation of Handsontable, and you can’t avoid referring to Walkontable (for example, in your custom editor or plugin), update your Walkontable references from handsontableInstance.view.wt to handsontableInstance.view._wt.