getnikola / nikola

A static website and blog generator
https://getnikola.com/
MIT License
2.6k stars 445 forks source link

submenu: click on the parent item, then clicking elsewhere makes the whole menu item gone #1714

Closed xuhdev closed 9 years ago

xuhdev commented 9 years ago

You can reproduce the bug on my website.

  1. Click on the "About" menu,
  2. then click elsewhere on the webpage (any blank space),
  3. see the "About" menu gone.

I can reproduce this bug on bootstrap3 and bootstrap3-gradient theme.

I'm using nikola 7.4.1

ralsina commented 9 years ago

Hmmm looks like clicking outside the menu is setting display: none on the li ... maybe we are not generating exactly correct HTML for the menu.

Kwpolska commented 9 years ago

I cannot reproduce with a clean site. Maybe you have some fancy JS that conflicts with Bootstrap’s?

Normal (clean) site:

<li class="dropdown">
↓  open ↓
<li class="dropdown open">
↓ close ↓
<li class="dropdown">

Your site:

<li class="dropdown">
↓  open ↓
<li class="dropdown open" style="display: block;">
↓ close ↓                 ^^^^^^^^^^^^^^^^^^^^^^^
<li class="dropdown" style="display: none;">
                     ^^^^^^^^^^^^^^^^^^^^^^
Kwpolska commented 9 years ago

https://comments.topbug.net/js/count.min.js seems to be at fault, according to Chrome’s Web Inspector (with Break on attributes modifications)

Kwpolska commented 9 years ago

This is isso’s fault. It looks like it’s a bit too greedy when it comes to registering its handlers — and it seems to mess with Bootstrap’s own dropdown code.

cc @posativ (isso dev) — please investigate.

posativ commented 9 years ago

Played around a bit with Chrome's Devtools and I have no idea why this might happen. @Kwpolska I do not register any handlers (except dom ready boilerplate), maybe a dependency interferes here.

Edit, it is caused by extending DOM elements, appearently outside of a namespace,

xuhdev commented 9 years ago

@posativ Thanks for investigation. Let me know if you need any help