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

ui-select with append-to-body="true" doesn't updates its position on window or container resize. #1254

Open
dmitriyws opened this issue Oct 20, 2015 · 9 comments

Comments

@dmitriyws
Copy link

Issue: I have an ui-select element somewhere in container with the append-to-body attribute true, if I open the dropdown and resize the window the element will remain at the same position, fixed.

Fix needed: Update dropdown position on resize.

@chris-hanson
Copy link

+1 did you find a solution for this?

@patrickhousley
Copy link
Contributor

+1 need a fix for this as well. Playing around with trying to bind the position of the body bound element with the placeholder created when opening the select. However, having trouble with the watch not updating...changes to the elements offset does not cause a digest cycle.

@patrickhousley
Copy link
Contributor

Try out http://plnkr.co/edit/G02EbD?p=preview. I added a watch to the placeholder offset that updates the selects positioning. The only problem I can see right now is if the select is within a scrollable div and the user scrolls the placeholder outside of the div, the select is still visible. Works great for resizing and side scrolling.

@wesleycho
Copy link
Contributor

Just noting that positioning is a hard problem - this may best be solved by trying to split out the position module from UI Bootstrap and then using it here, as this is for the most part a solved problem in UI Bootstrap, along with all of the robust placement support present in the Bootstrap 3 library itself, including auto positioning.

@JimiC
Copy link

JimiC commented Jun 29, 2016

Had the same issue and I resolved it by setting append-to-body="false".

@davidsalamon
Copy link

This (not coincidentally) also happens when you scroll parent container div.

@13W 13W mentioned this issue Oct 31, 2017
@sumeetsonawane11
Copy link

@JimiC : I have set append-to-body="false", but it is hiding my dropdown menus now.
although it is present in the DOM.

@JimiC
Copy link

JimiC commented Aug 3, 2018

@sumeetsonawane11 Two years after my answer may not apply anymore.

@nicktobolski
Copy link

I'm still encountering this issue when scrolled in the parent container. Will the fix be re-reviewed/updated or is this lib defunct?

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

No branches or pull requests

8 participants