From efc8e31fd17db14e6d02098bf1dfff4985a7dabe Mon Sep 17 00:00:00 2001 From: Xen0Xys Date: Tue, 30 Jul 2024 16:26:46 +0200 Subject: [PATCH] :bug: Fix WCS recovering when widget is out of sight --- js/models/event_handler.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/models/event_handler.js b/js/models/event_handler.js index 1b095cab..d5d6fc68 100644 --- a/js/models/event_handler.js +++ b/js/models/event_handler.js @@ -158,9 +158,12 @@ export default class EventHandler { this.model.save_changes(); }); - this.aladin.on("resizeChanged", () => { + this.aladin.on("resizeChanged", (width, height) => { + // Skip resize event when the div is hidden + if (width === 1 && height === 1) return; this.updateWCS(); this.update2AxisFoV(); + this.model.set("_height", height); this.model.save_changes(); });