From a2012ef00b7370c9c38de1bcaa3263816ee6a663 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Fri, 5 Nov 2021 14:23:11 +0100 Subject: [PATCH] Bugfix --- src/OSDAnnotationLayer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/OSDAnnotationLayer.js b/src/OSDAnnotationLayer.js index f998a21..bd46a03 100644 --- a/src/OSDAnnotationLayer.js +++ b/src/OSDAnnotationLayer.js @@ -204,7 +204,10 @@ export class AnnotationLayer extends EventEmitter { if (shape?.annotation !== this.hoveredShape?.annotation) { if (this.hoveredShape) { this.viewer.gestureSettingsByDeviceType('mouse').clickToZoom = zoomGesture; - removeClass(this.hoveredShape, 'hover'); + + const element = this.hoveredShape.element || this.hoveredShape; + removeClass(element, 'hover'); + this.emit('mouseLeaveAnnotation', this.hoveredShape.annotation, this.hoveredShape); }