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

add ability to control navbar dropdown menu horiz direction #10370

Closed
mathiasdb opened this issue Sep 2, 2013 · 13 comments
Closed

add ability to control navbar dropdown menu horiz direction #10370

mathiasdb opened this issue Sep 2, 2013 · 13 comments
Milestone

Comments

@mathiasdb
Copy link

[Original title: Navbar.pull-right dropdown.pull-left doesn't work.]

This should fix it:

.navbar-nav > li > .dropdown-menu.pull-left {
right: auto;
left: 0;
}

@juthilo
Copy link
Collaborator

juthilo commented Sep 2, 2013

Please provide a live example of the problem (e.g., via http://jsbin.com/aKiCIDO/1/edit).

@cvrebert
Copy link
Collaborator

cvrebert commented Sep 2, 2013

You should be using .navbar-left instead of .pull-left when aligning things in the navbar.

@mathiasdb
Copy link
Author

Hi

This should help: http://jsbin.com/EpIpevo/2/edit?html,output.
It all comes down to the css in the

    in the second .navbar-nav.

    P.S. pm. me if i'm using bootstrap the wrong way!

    Mvg
    Alvast Bedankt

@cvrebert
Copy link
Collaborator

cvrebert commented Sep 2, 2013

Per the navbar docs examples, I'm pretty sure you shouldn't be using alignment classes on elements within a list.

@mathiasdb
Copy link
Author

Hi

I read the docs again and found that
Component alignment

Align nav links, forms, buttons, or text, using the .navbar-left or .navbar-right utility classes. Both classes will add a CSS float in the specified direction. For example, to align nav links, put them in a separate

    with the respective utility class applied.

    These classes are mixin-ed versions of .pull-left and .pull-right, but they're scoped to media queries for easier handling of navbar components across device sizes.

    So do you have a solution for my problem?

@cvrebert
Copy link
Collaborator

cvrebert commented Sep 2, 2013

I'm not really sure what you're trying to do in the first place.

@mathiasdb
Copy link
Author

Well I want the first

    in the navbar to be aligned right. And I want the
      to be aligned left. Like I illustrated at jsbin. Checkout how the drop down is positioned in the first navbar and checkout how the drop down is positioned in the second navbar. http://jsbin.com/EpIpevo/2/edit?html,output

      BTW. I am currently not looking for any behaviour on devices smaller than 970px.

      Mathias De Beyser
      Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

      On Monday 2 September 2013 at 20:51, Chris Rebert wrote:

      I'm not really sure what you're trying to do in the first place.


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

@cvrebert
Copy link
Collaborator

cvrebert commented Sep 2, 2013

So, it's that you want to control which horizontal direction the options-list portion of the dropdown menu "bulges" out in?

@mathiasdb
Copy link
Author

Yeah

Exactly! The weird thing is when the navbar-left is set then I am able to control the horizontal direction of the drop down menu using

    or
      but when navbar-right is set, that trick no longer works...

      Mathias De Beyser
      Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

      On Monday 2 September 2013 at 21:31, Chris Rebert wrote:

      So, it's that you want to control which horizontal direction the options-list portion of the dropdown menu "bulges" out in?


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

@cvrebert
Copy link
Collaborator

cvrebert commented Sep 2, 2013

The issue is that it's a hack and the alignment classes aren't meant to be used just to mess with the menu like that.
I am going to reinterpret this issue as a request for a proper way to control the menu direction.

@mathiasdb
Copy link
Author

Hi

Thx for understanding.
Srry for my inadequate english

BTW. I was trying to use the .pull-left trick/hack cause the docs for a "drop down" say that:
Aligninment options

Add .pull-right to a .dropdown-menu to right align the dropdown menu.

@cvrebert
Copy link
Collaborator

cvrebert commented Sep 2, 2013

Huh. Didn't know that. Well, then I guess it's more that it doesn't happen to work in the navbar and a new class would probably be necessary to do it cleanly.

@mathiasdb
Copy link
Author

The weirdest thing of all is that their is a class that clears the other way around.

So the default behaviour of a navbar-left, pulls the drop down list left. If you give that drop down list the class .pull-right. You get the behaviour you would expect. The horizontal alignment of the drop down list will be right.

This is cleared by this line of css (this line can be found in bootstrap.css, just CMD+F .pull-right)
.navbar-nav > li > .dropdown-menu.pull-right {
right: 0;
left: auto;
}

But their is no clear/fix for the other way around. So in this case the default behaviour of a navbar-right, pulls the drop down list right… Right? :) If you give that drop down list the class .pull-left. You would expect that the drop down list would be horizontally aligned left. Doesn't work. That's why I proposed the line of css
.navbar-nav > li > .dropdown-menu.pull-left {
right: auto;
left: 0;
} // the inverse of the above.

@mdo mdo closed this as completed in 11c6ab7 Dec 14, 2013
@mdo mdo mentioned this issue Dec 14, 2013
stempler pushed a commit to stempler/bootstrap that referenced this issue Apr 11, 2014
…ent options

* Removes an old pair of selectors that didn’t properly target the
right-aligned navbar alignment of dropdown menus.
* Deprecates the `.pull-right` alignment in favor of a more specific
and unique class name.
* Adds `.dropdown-menu-right` as the new alignment class. This is then
mixin-ed into the `.navbar-right.navbar-nav` dropdown menus for
auto-alignment.
* To override that auto-alignment, use `.dropdown-menu-left` as needed.
stempler pushed a commit to stempler/bootstrap that referenced this issue Nov 4, 2014
…ent options

* Removes an old pair of selectors that didn’t properly target the
right-aligned navbar alignment of dropdown menus.
* Deprecates the `.pull-right` alignment in favor of a more specific
and unique class name.
* Adds `.dropdown-menu-right` as the new alignment class. This is then
mixin-ed into the `.navbar-right.navbar-nav` dropdown menus for
auto-alignment.
* To override that auto-alignment, use `.dropdown-menu-left` as needed.
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

3 participants