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

Add "appendTo" functionality to dropdown #4467

Closed
jaydiablo opened this issue Sep 24, 2015 · 1 comment
Closed

Add "appendTo" functionality to dropdown #4467

jaydiablo opened this issue Sep 24, 2015 · 1 comment

Comments

@jaydiablo
Copy link
Contributor

I noticed there were a couple of PRs for the modal component that try to do something similar, this would be for the dropdown component.

I have an interesting use case where append-to-body isn't quite what we need, but not having it suffers from the issues that append-to-body was made for.

This was actually mentioned in #4240 (second comment) which is demonstrated by this plunkr: http://plnkr.co/edit/1EuLWcCSv47tCi7i5H6N?p=preview

Like the plunkr, I have a static body element that contains a scrollable div, which is where the dropdown toggles are. If the dropdown is opened (and appended to body), and the user scrolls, the dropdown body stays in place (since it's appended to body, and the body isn't the element that's scrolling).

Appending inline (default behavior without append-to-body) doesn't work in this case, as the element that the dropdowns will appear in may have hiding overflow, so the dropdowns will appear cut off.

I'd like to look into adding an "appendTo" (dropdown-append-to) feature to dropdowns so that I can pass in an element that the dropdown body would be appended to.

Thoughts on this?

@jaydiablo
Copy link
Contributor Author

I have a prototype of this working well.

You pass in an angular.element object and it uses that as the container, pretty much how append-to-body works (and pretty much using all of the same code).

I'd like to put together a PR. Does this sound like the best approach? I noticed in the modal PRs that it was suggested to go this route, rather than passing in a selector, to make things simpler and easier to test.

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

Successfully merging a pull request may close this issue.

2 participants