yalabot / angular-foundation

http://pineconellc.github.io/angular-foundation/
Other
1.05k stars 266 forks source link

Dropdowns close when anything vaguely bound to it updates #301

Open BenWoodford opened 8 years ago

BenWoodford commented 8 years ago

EDIT: Wasn't the line I thought it was, but something is very off.

Whenever anything in my app updates that has some distant binding to the dropdown, the dropdown closes without firing closeMenu.

It seems that the link function on the directive is called every time something happens within any sort of scope with it, because of how bindings work... and this is calling the following line:

if(dropdown) {
    dropdown.css('display', 'none');
}
jbrowning commented 8 years ago

Thanks for reporting! Can you please create a plunk or jsfiddle demonstrating your issue?

BenWoodford commented 8 years ago

Bear with me, I'm actually not entirely sure what it was causing the link to be called whenever something updated. Trying to repeat it in Plunker without much luck... From what I've read link is called every time the scope changes, which means the dropdown closes itself when something in scope changes... just not sure how to replicate that right now.