From 1fcbfd812533e23564af5df632a6f234651ab19e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Mart=C3=ADnez?= Date: Thu, 4 Sep 2025 00:59:54 +0300 Subject: [PATCH] add input window left offset --- src/lib/util/dropdown.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/util/dropdown.ts b/src/lib/util/dropdown.ts index 9234379..44baaea 100644 --- a/src/lib/util/dropdown.ts +++ b/src/lib/util/dropdown.ts @@ -17,8 +17,8 @@ export function getDropdownPosition( const baseLeft = left + input.offsetLeft + DROPDOWN_MARGIN; // Check for horizontal overflow and adjust if necessary - const adjustedLeft = baseLeft + DROPDOWN_WIDTH > window.innerWidth - ? window.innerWidth - DROPDOWN_WIDTH - DROPDOWN_MARGIN + const adjustedLeft = baseLeft + inputRect.left + DROPDOWN_WIDTH > window.innerWidth + ? inputRect.width - DROPDOWN_WIDTH - DROPDOWN_MARGIN : baseLeft; // Is there place for the dropdown below the caret?