From 057dda5d828bacd801af5e56c4f228f58f06e410 Mon Sep 17 00:00:00 2001 From: bitgiga Date: Mon, 12 Aug 2024 12:14:41 +0000 Subject: [PATCH 1/2] fixed bug where completion box would not take in account for scroll and on somme mobile devices when user zooms and clicks on textarea the completion box would be on diffrent place --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 2f4e40a..8c0bd4d 100644 --- a/src/index.js +++ b/src/index.js @@ -593,8 +593,9 @@ DjangoQL.prototype = { const inputRect = this.textarea.getBoundingClientRect(); const top = window.pageYOffset + inputRect.top + inputRect.height; + const left = inputRect.left + window.scrollX; this.completion.style.top = `${top}px`; - this.completion.style.left = `${inputRect.left}px`; + this.completion.style.left = `${left}px`; this.completion.style.display = 'block'; }, From b925e97a50471ae5bd7f4fbc59ce8e02ad5dbed2 Mon Sep 17 00:00:00 2001 From: bitgiga Date: Mon, 12 Aug 2024 12:20:30 +0000 Subject: [PATCH 2/2] Initial commit