diff --git a/CHANGELOG.md b/CHANGELOG.md index 70f16e31..1a7dfbae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## [2.14.4](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.3...v2.14.4) (2023-11-16) + + +### Bug Fixes + +* **pb-view-annotate:** suppress pb-selection-changed event if annotation is deleted ([c5cb4d9](https://github.com/eeditiones/tei-publisher-components/commit/c5cb4d992c1fc9ee34167f3a942715ac55b8232a)) + +## [2.14.3](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.2...v2.14.3) (2023-11-16) + + +### Bug Fixes + +* **pb-authority-lookup,custom:** trigger pb-authority-error if saving to local registry fails ([66edabc](https://github.com/eeditiones/tei-publisher-components/commit/66edabc50913c38bcf20a9094d995800f8c17271)) + ## [2.14.2](https://github.com/eeditiones/tei-publisher-components/compare/v2.14.1...v2.14.2) (2023-11-15) diff --git a/package-lock.json b/package-lock.json index b21628a0..b3484dcf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.2", + "version": "2.14.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@teipublisher/pb-components", - "version": "2.14.2", + "version": "2.14.4", "license": "GPL-3.0-or-later", "dependencies": { "@babel/runtime": "7.11.2", diff --git a/package.json b/package.json index 0184d9bb..58f805fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@teipublisher/pb-components", - "version": "2.14.2", + "version": "2.14.4", "description": "Collection of webcomponents underlying TEI Publisher", "repository": "https://github.com/eeditiones/tei-publisher-components.git", "main": "index.html", diff --git a/src/pb-view-annotate.js b/src/pb-view-annotate.js index 253d4958..18802e6f 100644 --- a/src/pb-view-annotate.js +++ b/src/pb-view-annotate.js @@ -278,7 +278,7 @@ class PbViewAnnotate extends PbView { /** @param {Event} event */ this._eventHandler = event => { - if (event.type === 'selectionchange' && this._inHandler) { + if (event.type === 'selectionchange' || this._inHandler) { return; } if (event.type === 'mousedown') { @@ -657,9 +657,16 @@ class PbViewAnnotate extends PbView { window.requestAnimationFrame(() => this.refreshMarkers()); - const selection = this._getSelection(); - selection.removeAllRanges(); - selection.addRange(newRange); + this._inHandler = true; + try { + const selection = this._getSelection(); + selection.removeAllRanges(); + selection.addRange(newRange); + } catch(e) { + console.error(' %s', e.message); + } finally { + this._inHandler = false; + } } editAnnotation(span, properties) {