From 7f9b1d0e9acbb15905aff589a114af1385590f2a Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Sun, 29 Mar 2020 09:54:48 -0700 Subject: [PATCH] Account for container offset when positioning combobox dropdowns (close #7458) --- modules/ui/combobox.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ui/combobox.js b/modules/ui/combobox.js index 2a042f524..1a11fced9 100644 --- a/modules/ui/combobox.js +++ b/modules/ui/combobox.js @@ -389,12 +389,13 @@ export function uiCombobox(context, klass) { .order(); var node = attachTo ? attachTo.node() : input.node(); + var containerRect = container.node().getBoundingClientRect(); var rect = node.getBoundingClientRect(); combo - .style('left', (rect.left + 5) + 'px') + .style('left', (rect.left + 5 - containerRect.left) + 'px') .style('width', (rect.width - 10) + 'px') - .style('top', rect.height + rect.top + 'px'); + .style('top', (rect.height + rect.top - containerRect.top) + 'px'); }