-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix #9427 - Dropdown menu mouseout ignored #9443
Fix #9427 - Dropdown menu mouseout ignored #9443
Conversation
Fix foundation#9427 The hide delay of the visible dropdown is replaced by the delays of the lastly triggered dropdown, so the hide function is never called on the currently visible dropdown. Remember and cancel the delay inside each element. So a visible dropdown remember its hide delay even if several dropdown must be hidden.
I don't think this fix is quite right... This changes us from putting the event handler on a shared This approach (breaking it down to the individual dropdowns) may be correct, but we should put these on the JavaScript object (e.g. |
What do you mean by The other solution is an array |
Sorry was thinking e.g. in init
and then in the code mentioned
Now all of our timeouts are on the JS object itself, so if this JS object gets destroyed they should get cleaned up appropriately. |
I already tried what you proposed, but we can't use a jQuery or DOM element as an index, because it is converted to a string " |
bother. What if we do something like
|
I find it dirty :/ |
yeah... the more I'm fighting with this the less I see an ideal solution, or at least not a fast one... maybe just stash it on the elem as you have it but then add a cleanup in |
Wasn't there components that has faced the same problem ? Attach datas to a specific element seems to me to be ordinary. |
@ncoden data isn't problematic, the issue I've run into in the past is with JS closures. You can end up in a situation where you have a reference from JS to elem and elem to JS where the browser doesn't know how clean it up correctly automatically.. we stash data on elements all the time, but try to house all of the logic inside a single attached object that we then explicitly clean up |
So if I had a set of functions to handle an array |
@ncoden I'd say so. |
Ok. I will do this. |
So, I something that can be used like this: var elemDatas = Foundation.ElemStore(this).datas;
elemDatas.delay = ...;
elemDatas.data = ...;
...
Foundation.ElemStore(this).destroy(); // or .delete() Before I realized this is almost the same thing as jQuery @kball Should I rather use jQuery |
It's fine to use |
It allow to destroy the saved datas more easily.
Fix #9427
What happens:
The hide delay of the visible dropdown is replaced by the delays of the lastly triggered dropdown, so the hide function is never called on the currently visible dropdown.
Solution:
Remember and cancel the delay inside each element. So a visible dropdown remember its hide delay even if several dropdown must be hidden.
Changes:
this.delay
instead of_this.delay