From e8accfdfafa231a8b50e1706e7bec29e280737fe Mon Sep 17 00:00:00 2001 From: Mark Salsbery <> Date: Wed, 17 Mar 2021 13:04:13 -0700 Subject: [PATCH] ReferenceStrip: Fixed destroy() exception and made element focusable --- changelog.txt | 2 ++ src/referencestrip.js | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 3e4c2d66..870c3aeb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -41,6 +41,8 @@ OPENSEADRAGON CHANGELOG * Added setImageFormatsSupported function (#1954 @pandaxtc) * Added dragToPan to the GestureSettings class, implemented in Viewer (#1956 @msalsbery) * Added preventDefault option to MouseTracker handlers: scrollHandler, keyDownHandler, keyUpHandler, keyHandler (#1957 @msalsbery) +* ReferenceStrip: Fixed issue where its element was being removed from its parent element twice on destroy, causing an exception (#1957 @msalsbery) +* ReferenceStrip: Made its element focusable for keyboard navigation (#1957 @msalsbery) 2.4.2: diff --git a/src/referencestrip.js b/src/referencestrip.js index 1d4b7104..20dd9ea9 100644 --- a/src/referencestrip.js +++ b/src/referencestrip.js @@ -96,6 +96,8 @@ $.ReferenceStrip = function ( options ) { this.minPixelRatio = this.viewer.minPixelRatio; + this.element.tabIndex = 0; + style = this.element.style; style.marginTop = '0px'; style.marginRight = '0px'; @@ -281,7 +283,7 @@ $.ReferenceStrip.prototype = { this.tracker.destroy(); if (this.element) { - this.element.parentNode.removeChild(this.element); + this.viewer.removeControl( this.element ); } } @@ -305,6 +307,8 @@ function onStripClick( event ) { this.viewer.goToPage( page ); } + + this.element.focus(); }