close: Clear previous highlights before displaying popup corrections

Closes #2
This commit is contained in:
Aljaž Grilc 2025-01-13 11:25:25 +01:00
parent ac7fe2b90e
commit 14e4893b8d

View File

@ -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)