Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Right alignment is off for dropdown-append-to-body .dropdown-menu-right when there's no vertical scrollbar #5942

Closed
dolevd opened this issue May 30, 2016 · 1 comment

Comments

@dolevd
Copy link
Contributor

dolevd commented May 30, 2016

Bug description:

As pointed out by @achenxp, my fix for issue #4317 is incorrect, and causes the dropdown to receive the wrong position when there's no overflow (and the vertical scrollbar is hidden).
This is because the fix always adds the scrollbar width to the position, without checking if the parent (body) element overflows.

Note: I have a working fix at my fork here: dolevd@f838eb6
This fix checks for overflow whenever the dropdown is open and is right aligned relative to the body, and calculates the position accordingly.
I'll submit this fix as a pull request shortly.

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/dIXoXxcH7RoeyHYIB4qw?p=preview

Notice that the first dropdown is incorrectly aligned to the right.

Version of Angular, UIBS, and Bootstrap

Angular: 1.5.5

UIBS: 1.3.3

Bootstrap: 3.3.6

@almeidap
Copy link

almeidap commented Jun 13, 2016

Would be great to have the provided PR (#5943) tested and merged as we are still relying on a temporary hotfix branch (cf. https://github.com/admin-ch/bootstrap-bower/tree/1.3.3-hotfixes).

The fix solves the positioning problem with right-aligned & dropdown-append-to-body dropdown menus but the menu position is not correctly updated when a window resize occurs (already reported here: #4317 (comment)).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants