Hi- did anything come of this? I'm still having the same issue.
Thanks,
joe
Nope... this was never fixed...
|
<SfMenu CssClass="dock-menu" Items="@MainMenuItems" Orientation="@VerOrientation" HamburgerMode="true" ShowItemOnClick="true"></SfMenu>
|
Hi Syncfusion,
I also face similar issue. I also don't want to collapse parent on subitem click in hamburger mode.
In the Demo video you showed. when you click "Comments" then clicked "Category 2". Is there a way for Comments to remain open and not to collapse ?
Thanks
Paul
|
<SfMenu TValue="MenuItem" Orientation="Orientation.Vertical" HamburgerMode="true" ShowItemOnClick="true" CssClass="dock-menu" @ref="MenuObj">
<MenuItems>
<MenuItem Text="File" Id="file">
<MenuItems>
<MenuItem Text="Open" Id="open" ></MenuItem>
<MenuItem Text="Save" Id="save" ></MenuItem>
<MenuItem Text="Exit" Id="exit" ></MenuItem>
</MenuItems>
</MenuItem>
<MenuItem Text="Go" Id="go"></MenuItem>
<MenuItem Text="Help" Id="help"></MenuItem>
</MenuItems>
<MenuEvents TValue="MenuItem" OnClose="onClose" ItemSelected="itemSelected"></MenuEvents>
</SfMenu>
@code {
SfMenu<MenuItem> MenuObj;
public bool isClose = false;
private async Task itemSelected(MenuEventArgs<MenuItem> args)
{
if(args.Item.Items != null)
{
isClose = false;
} else {
isClose = true;
}
//For handling parent item without submenu
if(args.Item.Text == "Go" || args.Item.Text =="Help")
{
await MenuObj.Close();
isClose = false;
}
}
private void onClose(BeforeOpenCloseMenuEventArgs<MenuItem> args)
{
//To make the submenu remain open
if (isClose)
{
args.Cancel = true;
}
}
} |
Hi Gayathri KarunaiAnandam,
Thank you for your reply. Sorry I was not clear with my requirements.
Actually I also did same approach as you did.
But my requirement is a little bit different. I'm using it as a navbar. I want the menu to remain open unless I click parent to collapsed.
In this code, if i click outside the menu, it always collapse. It should remain open.
E.G.
Hi Sangeetha M,
Can I follow up regarding this issue ?
Thanks
Paul
Hi Paul,
We have issue related to your requirement. So, will provide the sample after the below issue has been resolved. You can track its status from the below feedback link.
Feedback Link: https://www.syncfusion.com/feedback/34184/issue-occur-while-using-menu-with-showitemonclick-is-enabled
The fix will be available in our upcoming patch release which is scheduled for May 4th 2022.
Regards,
Thaneegairaj S
Hi Paul,
We are facing more complexity on implementing this fix. So, we have planned to include this in our upcoming patch release, which will be scheduled on 18th May ,2022. We appreciate your patience until then.
You can also track the status of this bug by using below feedback portal link
Feedback Link: https://www.syncfusion.com/feedback/34184/issue-occur-while-using-menu-with-showitemonclick-is-enabled
Regards,
YuvanShankar A
Hi Paul,
We are sorry for the inconvenience. The issue is due to some technical glitches at our end. We will resolve this in our volume 2 release, which is scheduled on end of the June month, 2022. Please use the below custom package until then.
Custom package: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Syncfusion.Blazor.20.1.0.5684499604
And, we have prepared the sample based on your requirement. Please refer the below code snippet.
[Index.razor]:
|
@using Syncfusion.Blazor.Navigations @inject IJSRuntime JS
<SfMenu @ref="MenuObj" TValue="MenuItem" HamburgerMode="true" ShowItemOnClick="true"> <MenuItems> <MenuItem Text="File" Id="file"> <MenuItems> <MenuItem Text="Open" Id="open"></MenuItem> <MenuItem Text="Save" Id="save"> <MenuItems> <MenuItem Text="Save As" Id="saveas"></MenuItem> <MenuItem Text="Save To" Id="saveto"></MenuItem> <MenuItem Text="Save File" Id="savefile"></MenuItem> </MenuItems> </MenuItem> <MenuItem Text="Exit" Id="exit"></MenuItem> </MenuItems> </MenuItem> <MenuItem Text="Go" Id="go"></MenuItem> <MenuItem Text="Help" Id="help"></MenuItem> </MenuItems> <MenuEvents TValue="MenuItem" OnClose="onClose" ItemSelected="itemSelected"></MenuEvents> </SfMenu>
@code{ SfMenu<MenuItem> MenuObj; public bool isClose = true; public bool isDocumentClick = false;
protected override void OnAfterRender(bool firstRender) { if (firstRender) { var lDotNetReference = DotNetObjectReference.Create(this); JS.InvokeVoidAsync("GLOBAL.SetDotnetReference", lDotNetReference); } }
private void itemSelected(MenuEventArgs<MenuItem> args) { if (args.Item.Items != null) { isClose = false; } else { isClose = true; } isDocumentClick = false; }
private void onClose(BeforeOpenCloseMenuEventArgs<MenuItem> args) { if (isClose || isDocumentClick) { args.Cancel = true; } }
[JSInvokable("HamburgerMenu")] public void documentClick() { isDocumentClick = true; } } |
[_Host.cshtml]:
|
<script> var GLOBAL = { }; GLOBAL.DotNetReference = null; GLOBAL.SetDotnetReference = function (pDotNetReference) { GLOBAL.DotNetReference = pDotNetReference; };
function bodyClick(e) { if (!document.querySelectorAll('.e-menu-header').length || !document.querySelectorAll('.e-menu-parent').length) { return; } if (!e.target.classList.contains("e-menu-container") && e.target.closest('.e-menu-container') == null) { if (GLOBAL.DotNetReference) { GLOBAL.DotNetReference.invokeMethodAsync("HamburgerMenu", "documentClick"); } } } </script> |
Please get back to us if you need further assistance on this.
Regards,
Yuvan Shankar A
Hi Paul,
We are glad to announce that our Essential Studio 2022 Volume 2 release v20.2.0.36 is rolled out. We have included the fix for this issue in this release and is available for download under the following link.
Feedback link: https://www.syncfusion.com/feedback/34184/issue-occur-while-using-menu-with-showitemonclick-is-enabled
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
YuvanShankar A
Hi,
I am facing with a problem during this operation
private void onClose(BeforeOpenCloseMenuEventArgs<MenuItem> args)
{
if (KeepOpen)
{
args.Cancel = true;
}
}
For menu it is okey. It is keeping the menu expanded as expected. (I am using this menu as a left navbar). When i click outside of the component it is checking for closing or not. But the main problem is that when i click into any syncfusion component such as inputs it is focusing out from my clicked input. How can i solve this problem.
Ender,
We have attempted to reproduce the issue in our end, but were unable to do so. We have created a sample and video demonstration to show that the input field can focus even the menu in expand.
If you are still experiencing the issue, please provide us with a reproducible sample or replicate the issue in our sample. Additionally, please share a video demonstration of the issue. With this information, we will be able to better understand the problem and work on a solution for you.
Regards,
YuvanShankar A