Fix incorrect check of Handsontable size options

Regression in 933a730928 introduced in 4.2.

This causes the discrepancy seen between 4.1 vs 4.2 (and later). In 4.2,
this check was broken, which means the event handler never gets added.

The combination of the event handler and the incorrect selector (fixed
in the next commit) would resize all Handsontable elements, resulting in
the bug where the table cannot be interacted with.

The commit b9f8a6b6c0 fixed another cause
of the issue, which was calling `resizeWidth(getWidth())`. The
getWidth() function should only be used to set the Handsontable's
settings, while resizeWidth should be called with '100%' as done within
the event handler.

However, seeing that the event listener is not even attached in 4.2
onwards, dispatching the resize event might not be necessary and
Handsontable might already handle this correctly. That said, let's
avoid making other changes that could potentially cause issues.

With this commit, the bug should reappear in 4.2 and later releases,
making it consistent with 4.1. The bug will be fixed in the next commit.
stable/4.2.x
Sage Abdullah 2023-05-12 11:38:39 +01:00 zatwierdzone przez Matt Westcott
rodzic 1b75648e03
commit 14b4b19e40
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -66,7 +66,7 @@ function initTable(id, tableOptions) {
}
}
if (hasOwn(!tableOptions, 'width') || hasOwn(!tableOptions, 'height')) {
if (!hasOwn(tableOptions, 'width') || !hasOwn(tableOptions, 'height')) {
// Size to parent field width if width is not given in tableOptions
$(window).on('resize', () => {
hot.updateSettings({