Skip to content

Instantly share code, notes, and snippets.

@m000
Created May 16, 2013 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m000/5592074 to your computer and use it in GitHub Desktop.
Save m000/5592074 to your computer and use it in GitHub Desktop.
Fix for bootstrap submenus on android devices. Clicking to open the submenu, would actually close the whole menu. This one line fix worked for me (forked from https://github.com/twitter/bootstrap/commit/37d0a30589e8bd74299b2d857c348d91396563ed). Dropdowns on iOS seem to work without needing any fix.
diff --git a/js/bootstrap-dropdown.js b/js/bootstrap-dropdown.js
index a1d5151..3a59467 100644
--- a/js/bootstrap-dropdown.js
+++ b/js/bootstrap-dropdown.js
@@ -49,7 +49,7 @@
isActive = $parent.hasClass('open')
- clearMenus()
+ if (! $parent.hasClass('dropdown-submenu')) clearMenus()
if (!isActive) {
$parent.toggleClass('open')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment