This repository has been archived by the owner on May 29, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #4467.
In a UI that we're building we ran into an issue where the dropdowns had to be attached to body (because their containing element had some sort of hidden overflow, like the bootstrap responsive tables) but the body in this app is a static "window", as there's a div element that the main content is scrolled in (this is because there's a snap.js drawer used). In this situation, if the dropdowns are appended to the body element, when the user scrolls after opening a dropdown, the dropdown menu would stay in a fixed position above the scrolling content beneath.
I've added a "dropdown-append-to" attribute that accepts an "angular.element" object and will use that element as the container for the dropdown menu when it is opened. This allows us to attach the dropdown to the scrolling container which makes them scroll with the content, but don't get cutoff by hidden overflow in their immediate container.
Here's a little gif I put together of the three types of "attachment" and how they look in this sort of situation:
This was actually taken from the angular-ui bootstrap docs that has the changes from this PR in them.
I added tests for this, and modified the docs/demo from dropdown as well.