ui-select icon indicating copy to clipboard operation
ui-select copied to clipboard

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

Open dmitriyws opened this issue 9 years ago • 9 comments

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.

dmitriyws avatar Oct 20 '15 09:10 dmitriyws

+1 did you find a solution for this?

chris-hanson avatar Nov 13 '15 01:11 chris-hanson

+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 avatar Feb 03 '16 00:02 patrickhousley

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.

patrickhousley avatar Feb 03 '16 18:02 patrickhousley

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.

wesleycho avatar Mar 28 '16 03:03 wesleycho

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

JimiC avatar Jun 29 '16 11:06 JimiC

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

davidsalamon avatar Oct 04 '16 15:10 davidsalamon

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

sumeetsonawane11 avatar Aug 03 '18 13:08 sumeetsonawane11

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

JimiC avatar Aug 03 '18 14:08 JimiC

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

nicktobolski avatar Aug 01 '19 18:08 nicktobolski