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 doesn't work with Form inside #302

Closed
mickeyckm opened this issue Sep 25, 2011 · 2 comments
Closed

Dropdown Menu doesn't work with Form inside #302

mickeyckm opened this issue Sep 25, 2011 · 2 comments

Comments

@mickeyckm
Copy link

Hi,

I put in a form with text input inside the

. I need to make some adjustment to the UI but is fine. However, the dropdown-js that comes with bootstrap, doesn't handle it well.

When I click on the textbox, the dropdown menu straightaway closes. Any work around for this?

Cheers,
Mickey

@zachwill
Copy link

If you have jQuery on the page, you can run the following to stop the propagation for all elements within the menu (given it's class is menu-dropdown).

var menu = $('.menu-dropdown').find('*');
menu.click(function(e) {
    e.stopPropagation();
});

Alternatively, you could just find the form.

var form = $('.menu-dropdown').find('form');
form.click(function(e) {
    e.stopPropagation();
});

@MattiJarvinen-BA
Copy link

@zachwill or even

$('.dropdown-menu').click(function (e) {
e.stopPropagation();
});

daveobriencouk pushed a commit to egocreative/bootstrap that referenced this issue Nov 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants