[GH #11390] this.htEditor is undefined

Tags: #<Tag:0x00007f51b69f5e48> #<Tag:0x00007f51b69f5ce0>

import Handsontable from ‘handsontable’;
import ‘handsontable/styles/handsontable.css’;
import ‘handsontable/styles/ht-theme-main.css’;

const colors = [
‘yellow’,
‘red’,
‘orange and another color’,
‘green’,
‘blue’,
‘gray’,
‘black’,
‘white’,
‘purple’,
‘lime’,
‘olive’,
‘cyan’,
];

const container = document.querySelector(’#example1’);

const hot = new Handsontable(container, {
licenseKey: ‘non-commercial-and-evaluation’,
data: [
[‘BMW’, 2017, ‘black’, ‘black’],
[‘Nissan’, 2018, ‘blue’, ‘blue’],
[‘Chrysler’, 2019, ‘yellow’, ‘black’],
[‘Volvo’, 2020, ‘white’, ‘gray’],
],
colHeaders: [‘Car’, ‘Year’, ‘Chassis color’, ‘Bumper color’],
columns: [
{
type: ‘autocomplete’,
editor: ‘autocomplete’,
source: [‘BMW’, ‘Chrysler’, ‘Nissan’, ‘Suzuki’, ‘Toyota’, ‘Volvo’],
strict: false,
},
{ type: ‘numeric’ },
{
type: ‘autocomplete’,
source: colors,
strict: false,
visibleRows: 4,
},
{
type: ‘autocomplete’,
source: colors,
strict: false,
trimDropdown: false,
},
],
autoWrapRow: true,
autoWrapCol: true,
});

window.addEventListener(‘focus’, async function(){
hot.updateSettings({
columns: [
{
type: ‘autocomplete’,
source: [‘BMW’, ‘Chrysler’, ‘Nissan’, ‘Suzuki’, ‘Toyota’, ‘Volvo’],
strict: false,
},
{ type: ‘numeric’ },
{
type: ‘autocomplete’,
source: colors,
strict: false,
visibleRows: 4,
},
{
type: ‘autocomplete’,
source: colors,
strict: false,
trimDropdown: false,
},
]
})
})

hteditorerror

error happens when clicking the cell with editor: autocomplete

https://jsfiddle.net/w0e1grq2/1/

the error happens on focus event by clicking cell.

Hi @apalma

I checked the demo you sent and I can’t get the same error. Please provide the steps on how to recreate it.

The error happens on focus event.

Click outside the page

Then click on cell

throws error

@apalma

I followed your steps and still not getting any errors in the console. I checked multiple variants clicking on different elements, opening the editor etc. but everything works fine.

Not sure why you cant recreate them.

Only two steps and I always got the error 100% of the time. Click outside the page to run window focus event then click on cell directly without clicking other element.

Screen-Recording

@apalma

That’s what I did. Tell me more about your environment, what OS and browser you are using?

Screen-Recording(1)

Windows 10

I am using Firefox and Chrome, both of them are throwing error.

Above is the same error from Chrome

Please let me know when you recreated it. Else I will be glad to show you in video call if I may.

FIY: There is no error in previous version of Handsontable. It is throwing on ver 15.

@apalma

I’ll do more testing and let you know if I was able to reproduce the issue.

Hi @apalma

We checked that together with @adrian.szymanski and it seems that this is the same issue as reported on our Github at https://github.com/handsontable/handsontable/issues/11390

We will update you within this thread as soon as the issue is fixed.

Hi @apalma

I just tested the demo with the newest build and I can no longer replicate the issue.

You could please test this demo https://jsfiddle.net/903avuf6/3/

Hi @aleksandra_budnik. I just tested it and that seems fixed the issue. Thank you.

Thank you for the confirmation.

I will update the thread once the new version (with the fix) is published.