Tabulator: avoid setting height if already at the correct height

Setting the height of a Tabulator can trigger all kinds of things,
including some buggy behaviour where all the jobs would disappear from
screen. Just don't do it unless it's necessary.
This commit is contained in:
Sybren A. Stüvel 2023-02-21 10:38:07 +01:00
parent e6ff81fc3d
commit 12f4d9b5ce
2 changed files with 12 additions and 0 deletions

View File

@ -242,6 +242,12 @@ export default {
}
const tableHeight = availableHeight - tableContainer.offsetTop;
if (this.tabulator.element.clientHeight == tableHeight) {
// Setting the height on a tabulator triggers all kinds of things, so
// don't do if it not necessary.
return;
}
this.tabulator.setHeight(tableHeight);
},
},

View File

@ -226,6 +226,12 @@ export default {
}
const tableHeight = availableHeight - tableContainer.offsetTop;
if (this.tabulator.element.clientHeight == tableHeight) {
// Setting the height on a tabulator triggers all kinds of things, so
// don't do if it not necessary.
return;
}
this.tabulator.setHeight(tableHeight);
},
}