Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4 - Dropdown should adjust its placement to ensure it stays within viewport #17167

Closed
TheZoker opened this issue Aug 20, 2015 · 17 comments
Closed

Comments

@TheZoker
Copy link

With the new version, dropdown content does not reconize, when the element is out of view and does not change the align:
img_2015 08 20_23h35m40s_003_

@cvrebert
Copy link
Collaborator

Pretty sure the old version didn't do that either.

@TheZoker
Copy link
Author

Jup it did:
img_2015 08 20_23h38m47s_004_

@hnrch02
Copy link
Collaborator

hnrch02 commented Aug 20, 2015

.dropdown-menu-right is probably what you are looking for, this behavior hasn't changed from v3.

@cvrebert cvrebert changed the title v4 - Dropdown in navbar does not regonize content out of view v4 - Dropdown should adjust its placement to ensure it stays within viewport Aug 20, 2015
@TheZoker
Copy link
Author

@hnrch02 Nope did not add that class to the dropdown in v3:
img_2015 08 20_23h48m22s_005_

@hnrch02
Copy link
Collaborator

hnrch02 commented Aug 20, 2015

Can you post your v4 test as a JS Bin?

@kkirsche
Copy link
Contributor

@hnrch02 seems to have to do with being in a navbar I believe

V3 JSBin:
http://jsbin.com/rolitoqewi/edit?html,output

@cvrebert
Copy link
Collaborator

Ah, we used to special-case dropdowns within .navbar-right, but that class is gone in v4.
I do think it would be better to make the feature not navbar-specific. Should be feasible now that we're using Tether (see e.g. http://github.hubspot.com/drop/docs/welcome/ ).

@hnrch02
Copy link
Collaborator

hnrch02 commented Aug 20, 2015

Well, .navbar-right was replaced by .pull-right (for now, as @mdo said in Slack).

@lallmon
Copy link

lallmon commented Sep 19, 2015

A dropdown menu pulled right on a fluid navbar is probably one of the most common use cases.

Perhaps the dropdown menu should default to aligning its right side to the left side of the dropdown element, and the opposite be the special case.

@fat
Copy link
Member

fat commented Nov 15, 2015

yeah i'd rather us solve this particular use case in css since so easy/common - @mdo what are your thoughts?

we could move dropdown onto tether but makes dropdown plugin a bit more complicated

@cvrebert
Copy link
Collaborator

we could move dropdown onto tether but makes dropdown plugin a bit more complicated

IMHO, I think it's worth doing that. Way more robust.

@fat
Copy link
Member

fat commented Nov 15, 2015

yeah fair enough

@davidklebanoff
Copy link

The suggestion of a new placement library here: #19673 - seems to have better support for flipping than Tether.

@mdo mdo added this to the v4.1 ideas milestone Nov 26, 2016
@joviczarko
Copy link

joviczarko commented Nov 27, 2016

Until this is solved (after 1 year of talking about it, here is a quick solution)

.dropdown-menu {
right: 0;
left: initial;
}

And just add .navbar in front of the selector if you do not need this project wide...

@0wczar
Copy link

0wczar commented Jan 28, 2017

@joviczarko in v4 alpha6 not working. Can you please add demo via JSBin?

@erslater
Copy link

erslater commented Feb 6, 2017

This works in v4 alpha6: <div class="dropdown-menu" style="left:initial;right:0;" ...

@Johann-S
Copy link
Member

Closed and fixed by #22444

@mdo mdo removed this from the v4.1 ideas milestone Jun 18, 2017
@mdo mdo removed this from the v4.1 ideas milestone Jun 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests