-
Notifications
You must be signed in to change notification settings - Fork 424
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
Minor change for handleMenuItemClick #582
Comments
OK, have done this. it will be in the next release. @ghiscoding take note, it seemed trivial and a good idea. |
@6pac go ahead for the changes, please note that it's in 5 different plugins
|
OK, it appears that the code change is just in HeaderMenu.js, the others call that, so it's a flow on effect. It is non-breaking, though. |
if I look at the Grid Menu, it seems that I added a SlickGrid/controls/slick.gridmenu.js Lines 507 to 510 in 3991679
|
10-4 |
@6pac did you do code change for that or did you wanted me to create a PR? Cheers mate |
thanks @ghiscoding maybe better if you do it... |
- fixes #582 - the original issue only mentioned the HeaderMenu plugin but I went ahead and applied the same logic (and tested them all) on the following plugins - HeaderMenu - GridMenu - ContextMenu - CellMenu
done... and I went further and applied it to all plugins with menu that I found (4 of them) to have such behaviors. |
- fixes #582 - the original issue only mentioned the HeaderMenu plugin but I went ahead and applied the same logic (and tested them all) on the following plugins - HeaderMenu - GridMenu - ContextMenu - CellMenu
There is a simple change which can be made to allow for more dynamic decisions as to whether to hide the header menu for a given command.
In plugins/headerMenu.js
For the handleMenuItemClick function:
hideMenu() is called prior to checking whether there is a command.
This means every time you click a menu option the menu closes.
If you move hideMenu after the if block and wrap it as follows:
The result is the menu will only be hidden if a developer doesn't use e.preventDefault() in the onCommand handler.
This would also mean a developer's could decide whether to prevent the default depending on the command that is being handled.
The text was updated successfully, but these errors were encountered: