Account for container offset when positioning combobox dropdowns (close #7458)

This commit is contained in:
Quincy Morgan
2020-03-29 09:54:48 -07:00
parent eec1a23388
commit 7f9b1d0e9a
+3 -2
View File
@@ -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');
}