Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangmm committed Nov 17, 2023
2 parents 2c7ec1e + 951856e commit f3cfd45
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
15 changes: 11 additions & 4 deletions src/pb-view-annotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -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('<pb-view-annotate> %s', e.message);
} finally {
this._inHandler = false;
}
}

editAnnotation(span, properties) {
Expand Down

0 comments on commit f3cfd45

Please sign in to comment.