diff --git a/src/commands/view/ShowOffset.ts b/src/commands/view/ShowOffset.ts index 2f90c7d6ea..7e9c1cfa7a 100644 --- a/src/commands/view/ShowOffset.ts +++ b/src/commands/view/ShowOffset.ts @@ -18,6 +18,10 @@ export default { const zoom = this.em.getZoomDecimal(); const el = opt.el as HTMLElement | undefined; + if (!(el instanceof HTMLElement)) { + return; + } + if (!config.showOffsets || !el || isTextNode(el) || (!config.showOffsetsSelected && state == 'Fixed')) { editor.stopCommand(`${this.id}`, opts); return; diff --git a/src/selector_manager/model/Selector.ts b/src/selector_manager/model/Selector.ts index a74c0e4e65..9da1d71dde 100644 --- a/src/selector_manager/model/Selector.ts +++ b/src/selector_manager/model/Selector.ts @@ -191,7 +191,7 @@ export default class Selector extends Model