From b89abb74307c36ea99024e4767303b1dc4142b24 Mon Sep 17 00:00:00 2001 From: George Vasilakis Date: Mon, 21 Mar 2016 11:41:15 -0700 Subject: [PATCH] Properly apply right alignment when appendTo is used When appendTo is used and the dropdown is right-aligned the positioning is off because it is calculated relative to the window instead of the specified container. --- src/dropdown/dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dropdown/dropdown.js b/src/dropdown/dropdown.js index f5ae0ec269..b227c1af73 100644 --- a/src/dropdown/dropdown.js +++ b/src/dropdown/dropdown.js @@ -217,7 +217,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position']) if (!rightalign) { css.left = pos.left - appendOffset.left + 'px'; } else { - css.right = window.innerWidth - + css.right = appendTo.prop('offsetWidth') - (pos.left - appendOffset.left + $element.prop('offsetWidth')) + 'px'; } }