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

Dropdown should open UP instead of DOWN, when there is not enough space to render fully #148

Closed
slavinskas opened this issue Aug 7, 2014 · 48 comments
Milestone

Comments

@slavinskas
Copy link

When there is not enough space for dropdown to render fully, it should be rendered to the top of the element, as it is default behaviour for select2.

@slavinskas slavinskas changed the title Dropdown shoud open UP instead of DOWN, when there is not enough space on current view Dropdown should open UP instead of DOWN, when there is not enough space to render fully Aug 7, 2014
@dimirc
Copy link
Contributor

dimirc commented Aug 8, 2014

@slavinskas can explain a little more about this? maybe a picture if its something graphical that you refer to

@zackarychapple
Copy link

@dimirc similar to when you open a context window in chrome with right click. The direction it builds from the location of your mouse differs based on the draw height and the amount of space to the edge of the screen. If you do not have any space on a screen or the select is at the bottom of the page it should draw the elements up instead of down. is my understanding correct @slavinskas ?

@slavinskas
Copy link
Author

@zackarychapple yes, it's exactly what I meant.

@zackarychapple
Copy link

I would like to expand on the requirement to also offset right and left as a stretch goal.

@dimirc dimirc added this to the 0.12.x milestone Aug 11, 2014
@dimirc dimirc modified the milestones: 0.12.x, 0.10.x Aug 11, 2014
@burza
Copy link

burza commented Oct 2, 2014

+1 for this feature, how far is the implementation?

@DineshkumarT
Copy link

+1

On Thursday, October 2, 2014, Gregor Swatek [email protected]
wrote:

+1 for this feature, how far is the implementation?


Reply to this email directly or view it on GitHub
#148 (comment)
.

@cheahkhing
Copy link

+1 on this, this is an extremely helpful feature.

@meirb
Copy link

meirb commented Oct 20, 2014

+1

2 similar comments
@edsioufi
Copy link

edsioufi commented Nov 2, 2014

+1

@Maxyme
Copy link

Maxyme commented Nov 18, 2014

+1

@BadgerBadgerBadgerBadger

+1

Any progress?

@ninjasun
Copy link

+1

1 similar comment
@kedarbe
Copy link

kedarbe commented Jan 15, 2015

+1

@seiyria
Copy link

seiyria commented Jan 21, 2015

+1 - I would enjoy being able to also force it to render upwards always, if possible.

@onemenny
Copy link

+1

3 similar comments
@nameetpai
Copy link

+1

@andywunderlich
Copy link

+1

@wald-tq
Copy link

wald-tq commented Feb 24, 2015

+1

@FFelling
Copy link

This would definitely be nice to have.

This could also be a solution for the list falls behind overflow:hidden or overflow:auto containers #591.
"move drop down to base of to stop it from being cut off (drop.js) #591"

@seiyria
Copy link

seiyria commented Mar 19, 2015

Might want to update the milestone here if this hasn't been addressed yet.

@fxck
Copy link

fxck commented Apr 2, 2015

do want

@JeromeLam
Copy link
Contributor

I've created a PR with code that adds an up direction depending on how much vertical space is left for rendering. This works well for my local build.

Feel free to try it out on your own builds and upvote the PR if it works for you!

@gitnik
Copy link

gitnik commented Apr 17, 2015

👍

@cyrilf
Copy link

cyrilf commented May 11, 2015

👍

Just a simple question: As this issue is 9 months old, should I

  • wait hoping that you're going to fix/merge the PR soon
  • fork this repo (which I really don't want..)

?

Thanks!

@JeromeLam
Copy link
Contributor

@cyrilf brianfeister self-assigned PR #836 about 10 days ago, so it may get merged soon. Maybe you can leave a comment in the PR itself to generate more activity.

brianfeister pushed a commit that referenced this issue May 28, 2015
Issue #148 - Add up direction to dropdown rendering.
@cyrilf
Copy link

cyrilf commented May 28, 2015

Merged! Thanks again @JeromeLam (and @brianfeister ) 😉

@SerjoPepper
Copy link

@JeromeLam, hi
offsets calculated wrong when I have scroll on "body" element instead of "html"

offset.top + offset.height + offsetDropdown.height > $document[0].documentElement.scrollTop + $document[0].documentElement.clientHeight

should be replaced with

offset.top + offset.height + offsetDropdown.height > $document[0].documentElement.scrollTop + $document[0].body.scrollTop + $document[0].documentElement.clientHeight

@rachellej
Copy link

Same issue as @SerjoPepper -- and btw thanks for commenting the issue

@kwantopia
Copy link

Looks like if you use ui-select inside directives, on Chrome browsers the dropdown always goes up instead of dropping down.

@JoshSGman
Copy link

@kwantopia I'm having the same issue

@danduh
Copy link

danduh commented Jul 29, 2015

Is there any option/setting to disable this feature?

@ManuelPutallaz
Copy link

same question than @danduh : Is there any option/setting to disable this feature?

@greenwebdev
Copy link

Seeing the same issue as @kwantopia in Chrome, doing my head in. Any suggested fix?

@hyrumwhite
Copy link

Would love the ability to force it to always open down. Currently it's opening up no matter what I do.

@vladferix
Copy link

@hyrumwhite +1

2 similar comments
@oshai
Copy link

oshai commented Sep 3, 2015

@hyrumwhite +1

@bunsenmcdubbs
Copy link

@hyrumwhite +1

@calwi
Copy link

calwi commented Sep 8, 2015

Same issue here, inside a modal, it always opens up and goes slightly out of the window. Would like to force 'direction-down'.

@sdir456
Copy link

sdir456 commented Sep 9, 2015

+1

@pgeez
Copy link

pgeez commented Sep 13, 2015

with @hyrumwhite and @calwi , please add the ability to force 'direction-down'

@anonomis
Copy link

@hyrumwhite +1

@tandrianoff
Copy link

with @hyrumwhite and @calwi and @pgeez I also want to force either direction-down or direction-up.

@jraguilo
Copy link

I also really need the option to force "direction-down".

@dimirc
Copy link
Contributor

dimirc commented Sep 28, 2015

Related to #1212

@dimirc dimirc closed this as completed Sep 28, 2015
@alexpeattie
Copy link

Just for anyone who found this issue looking for a way to force dropdowns to go down, this is now possible with #1213 ☺️ - you just need to add position='down' to your <ui-select-choices> element or globally:

yourApp.config(function(uiSelectConfig) {
  uiSelectConfig.dropdownPosition = 'down';
})

@sbedulin
Copy link

@alexpeattie 👍 thanks

@soichih
Copy link

soichih commented Mar 10, 2016

@alexanderchan Thanks.

I had to use this option to force the choice element to bottom because ui-select currently does not provide scrolling capability for ui-select-multiple. If user enters tons of items, and ui-select-match element becomes too tall to be shown without scrolling the page, choice element could be displayed off-view (at the top of the match element).

It will be nice if there is a native way to set the maximum height for ui-select-match element..

@ArulselviArangasamy
Copy link

select2 dropdown position want to down only display

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