Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v12.0.0+] Crash when pressing the delete or backspace keys after deselecting a cell #10272

Closed
kalegos opened this issue Mar 9, 2023 · 4 comments
Labels
bug Core: Selection Plugin Regression Issues that were created while adding new changes to the source code Status: Released

Comments

@kalegos
Copy link

kalegos commented Mar 9, 2023

Description

Handsontable will crash if you click on a cell, then click on the empty area of the table body and press either delete or backspace

Steps to reproduce

  1. click on a cell
  2. click on the empty part of the table body (inside the main container where there are no additional rows) to deselect the cell
  3. press the delete or backspace button

Demo

Crash on landing page
Line that is crashing

Your environment

  • Handsontable version: 12.3.1
  • Browser name and version: Firefox
  • Operating system: Linux
@AMBudnik
Copy link
Contributor

Thank you for sharing the issue report, @kalegos

It seems that this issue appears when we have a container size defined, and we use Handsontable v12.0.0+. v11.1 works well https://jsfiddle.net/jvr9soq7/

On Firefox the error is

Uncaught TypeError: this.instance.getSelectedRangeLast() is undefined
    prepareEditor https://cdn.jsdelivr.net/npm/handsontable@12/dist/handsontable.full.js:30320
    callback https://cdn.jsdelivr.net/npm/handsontable@12/dist/handsontable.full.js:30238
    keyRecorder https://cdn.jsdelivr.net/npm/handsontable@12/dist/handsontable.full.js:107118
    onkeydown https://cdn.jsdelivr.net/npm/handsontable@12/dist/handsontable.full.js:107506
    mount https://cdn.jsdelivr.net/npm/handsontable@12/dist/handsontable.full.js:107546
    createShortcutManager https://cdn.jsdelivr.net/npm/handsontable@12/dist/handsontable.full.js:107133
    Core https://cdn.jsdelivr.net/npm/handsontable@12/dist/handsontable.full.js:66600
    Handsontable https://cdn.jsdelivr.net/npm/handsontable@12/dist/handsontable.full.js:91613
    <anonymous> https://fiddle.jshell.net/_display/?editor_console=true:116

but on Chrome, it's

Uncaught TypeError: Cannot read properties of undefined (reading 'highlight')
    at EditorManager.prepareEditor (handsontable.full.js:30320:71)
    at callback (handsontable.full.js:30238:18)
    at handsontable.full.js:107118:32
    at HTMLHtmlElement.onkeydown (handsontable.full.js:107506:32)

Minimal v12 demo for tests https://jsfiddle.net/jvr9soq7/

@AMBudnik AMBudnik added bug Core: Selection Plugin Regression Issues that were created while adding new changes to the source code labels Mar 10, 2023
@AMBudnik AMBudnik changed the title Crash when pressing the delete or backspace keys after deselecting a cell [v12.0.0+] Crash when pressing the delete or backspace keys after deselecting a cell Mar 10, 2023
@ganbat96
Copy link

Hello,

We're experiencing the same issue. It was working fine under Handsontable v3.0.0. Issue appeared after we upgraded to v12.

We've also found a workaround for it and it seems like working fine ...
#401 (comment)

Hope it helps...

@AMBudnik
Copy link
Contributor

Thank you for feedback @ganbat96

I will notify you as soon as we provide the official fix for this regression

@AMBudnik
Copy link
Contributor

Ho @kalegos I have good news!

We just released Handsontable v13.1.0 where this issue is solved. Thank you again for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core: Selection Plugin Regression Issues that were created while adding new changes to the source code Status: Released
Projects
None yet
Development

No branches or pull requests

4 participants