From 14e4893b8dbae7129eb6a9eb60f933255c760078 Mon Sep 17 00:00:00 2001 From: Aljaz Grilc Date: Mon, 13 Jan 2025 11:25:25 +0100 Subject: [PATCH] close: Clear previous highlights before displaying popup corrections Closes #2 --- service.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service.js b/service.js index 5886c5d..58b2f62 100644 --- a/service.js +++ b/service.js @@ -428,6 +428,9 @@ class BesService { */ popupCorrectionPanel(el, match, source, highlightEl) { const popup = document.querySelector('bes-popup-el') + document.querySelectorAll('.bes-mistake-highlight-selected').forEach(el => { + el.classList.remove('bes-mistake-highlight-selected') + }) popup.changeMessage(match.match.message) popup.appendReplacements(el, match, this, this.isContentEditable()) popup.show(source.clientX, source.clientY, highlightEl)