From 12f4d9b5ce572b2baffadabe3f497b13fed418af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 21 Feb 2023 10:38:07 +0100 Subject: [PATCH] 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. --- web/app/src/components/jobs/JobsTable.vue | 6 ++++++ web/app/src/components/jobs/TasksTable.vue | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/web/app/src/components/jobs/JobsTable.vue b/web/app/src/components/jobs/JobsTable.vue index 534e3806..8ceaa3c4 100644 --- a/web/app/src/components/jobs/JobsTable.vue +++ b/web/app/src/components/jobs/JobsTable.vue @@ -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); }, }, diff --git a/web/app/src/components/jobs/TasksTable.vue b/web/app/src/components/jobs/TasksTable.vue index 3f6fa29d..56d00991 100644 --- a/web/app/src/components/jobs/TasksTable.vue +++ b/web/app/src/components/jobs/TasksTable.vue @@ -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); }, }