From 4c7d9a2ffa058e5ae2d75c0bd33d499b257409a5 Mon Sep 17 00:00:00 2001 From: lokaesshwar Date: Fri, 14 Mar 2025 00:35:22 +0530 Subject: [PATCH] Resolved Duplicate IDs in overlay HTML --- src/overlay.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/overlay.js b/src/overlay.js index 61f5fa88..36ea93a1 100644 --- a/src/overlay.js +++ b/src/overlay.js @@ -135,8 +135,12 @@ if (this.element.id) { this.elementWrapper.id = "overlay-wrapper-" + this.element.id; } else { - this.elementWrapper.id = "overlay-wrapper"; + this.elementWrapper.id = "overlay-wrapper-" + crypto.randomUUID(); // Ensure unique ID } + + // Always add a class for easier selection + this.elementWrapper.classList.add("openseadragon-overlay-wrapper"); + this.style = this.elementWrapper.style; this._init(options);