-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Re-Hover doesn't work with 'bottom' settings (in Shopware) #86
Comments
Problem exists because the activate function gets executed but the deactivate function doesn't get executed |
This bug is a general bug and not related to bottom setting or Shopware. The bug also exists in the offical demo under: Steps to reproduce:
Expected result
Current result
|
Quite annoying indeed. I've just found out about this bug, which makes the plugin not a good fit for production. |
I've just found a workaround. It isn't ideal but it works: /**
* @function `init`
*
* Initializes the desktop navigation behavior.
*
* 1. Hide the panel on exit.
*/
function init() {
$navBar.menuAim({
rowSelector: navGroup,
activationDelay: 0,
activate: function(el) {
showNavPanel(el);
},
deactivate: function(el) {
hideNavPanel(el);
},
exit: function(el) {
hideNavPanel(el); /* [1] */
},
submenuDirection: 'above'
});
is_desktop_nav = true;
enableClickOnPanelLabel();
}
/**
* When leaving the panel, unbind the mouseenter event
* and initialize menuAim again. Not ideal as it doesn't destroy
* the first instance.
*/
$navPanel.on('mouseleave', function(e) {
e.preventDefault();
$navGroup.unbind('mouseenter');
init();
}); So basically: hide the nav panel on exit, bind a |
I tried your workaround and it does the job just fine. You basically just double force it. In my own workaround I made it exactly like that, even though it wasn't as elegant as yours. |
same issue |
The mouseleaveMenu function only triggers the deactivate function, if the exitMenu option is supplied and returns true: ` function activateSubmenu(row) { function deactivateSubmenu(row) { |
@heun01 is that how you suggest to fix it? 🤔 |
Yeah works for me. |
I had the same issue and I had overlooked this comment on exitMenu in the example config if you have a exitMenu option, it needs to return true
|
I've had the same issue, and wanted to share the complete solution:
This should be added in the docs, so other people can easily use this in their projects. |
@MBWebTechMariusz Thanks! We had no exitMenu callback implemented so we just added a function like you did and with that it works fine. I think there should be some workaround implemented which fixes that bug and let exitMenu return true by default, even if no callback is implemented. |
@rossmedia I think this is not the intended behaviour, see this post: #50 (comment) What do you think? |
@MBWebTechMariusz Oh yes sorry now i understand the problem. When i implement your solution the benefit of this plugin (work like amazons menu and don't close when you) is not working anymore. :( |
Yeah, this is a drawback. But I think this is intended, so we need to try it with just
|
I use the plugin to display submenu points on the bottom side of the navigation.
It works perfectly, but if I
the plugin doesn't execute.
Haven't found a workaround, yet. Maybe it is just because of the framework (Shopware) I use
The text was updated successfully, but these errors were encountered: