From 0f2fa218f3dfa8c22792462849037424983014aa Mon Sep 17 00:00:00 2001 From: Aljaz Grilc Date: Wed, 4 Jun 2025 11:50:41 +0200 Subject: [PATCH] Update popup positioning after using keyboard shortcut #4 --- service.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/service.js b/service.js index 91f733f..62cf58b 100644 --- a/service.js +++ b/service.js @@ -331,7 +331,7 @@ class BesService { } /** - * Called to report tab event + * Called to report keydown event * * @param {Event} e */ @@ -1187,7 +1187,10 @@ class BesService { BesPopup.clearReplacements() popup.setContent(el, match, this, this.isContentEditable()) this.highlightMistake(match) - popup.show(match.highlights[0].x, match.highlights[0].y) + match.highlights.forEach(el => { + const clientY = `${el.y + 150}` + popup.show(el.x, clientY) + }) } /** @@ -2961,6 +2964,7 @@ class BesPopup extends HTMLElement { * @param {Number} y Y location hint */ show(x, y) { + console.log(x, y) this.style.position = 'fixed' // Element needs some initial placement for the browser to provide this.offsetWidth and this.