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

.dropdown-menu does not work correctly within .btn-group-justified on Firefox #12467

Closed
FlameWolf opened this issue Jan 31, 2014 · 9 comments
Closed

Comments

@FlameWolf
Copy link

Example: http://getbootstrap.com/components/#btn-groups-justified

Here you can see that the left edge of the dropdown menu is positioned below the left edge of the first button in the group, instead of below the left edge of the button that triggered the menu.

(Also, the borders of the buttons that don't have the .dropdown-toggle class disappear in IE8.)

@FlameWolf
Copy link
Author

Okay, I have found a temporary solution for this issue, but bootstrap needs to fix this in their code.

I use the following CSS and JS:

        .btn-group-justified .dropdown-menu {
            left: auto
        }
        var addWindowResizeEventHandler = function(handler) {
            if(window.addEventListener)
                window.addEventListener("resize", handler);
            else if(window.attachEvent)
                window.attachEvent("resize", handler);
        };
        /*
        ...
        ...
        ...
        */
        var positionRightAlignedDropdownMenus = function() {
            $(".btn-group > .btn-group > .dropdown-menu-right").each(function(index) {
                var currentElement = $(this);
                currentElement.css("right", currentElement.parent().width() + "px");
                currentElement = null;
            });
        };
        $(function() {
            positionRightAlignedDropdownMenus();
            addWindowResizeEventHandler(positionRightAlignedDropdownMenus);
        });

For IE8, add this:

        <!--[if lte IE 8]>
        <style type="text/css">
        /*<![CDATA[*/
        .dropdown-menu-right {
            right: 0!important
        }
        .btn-group-justified > .btn-default {
            background-color: transparent
        }
        /*]]>*/
        </style>
        <![endif]-->

@cvrebert
Copy link
Collaborator

Can't reproduce in Mac Chrome or Android Chrome. Does your issue happen in any browsers besides IE8?

@FlameWolf
Copy link
Author

@cvrebert Yes: Firefox 26.

@cvrebert
Copy link
Collaborator

Confirmed for Firefox.

@cvrebert
Copy link
Collaborator

The IE8 border issue is unrelated; splitting that into a separate issue: #12476

@cvrebert
Copy link
Collaborator

The menu works fine on IE8–IE11.

@mdo mdo modified the milestones: v3.2.0, v3.1.1 Feb 11, 2014
@mdo
Copy link
Member

mdo commented Mar 9, 2014

Firefox should be releasing an update that allows relative positioning on table elements with their next version. Closing as a won't fix.

@mdo mdo closed this as completed Mar 9, 2014
@mdo mdo removed this from the v3.2.0 milestone Mar 9, 2014
@cvrebert
Copy link
Collaborator

@cvrebert
Copy link
Collaborator

Assuming that's the correct upstream bug, this ought to be fixed in Firefox 30/31.

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