BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Performing the following steps results in an ArgumentOutOfRangeException:
<SfDropDownButton>
<PopupContent>
<SfMenu @ref="HamburgerMenuObj"
TValue="MenuItem"
HamburgerMode="true"
ShowItemOnClick="true">
<MenuItems>
<MenuItem Text="Item"></MenuItem>
</MenuItems>
<MenuEvents TValue="MenuItem" ItemSelected="MenuItemSelected"></MenuEvents>
</SfMenu>
<DropDownButtonEvents Opened="MenuOpened"></DropDownButtonEvents>
</PopupContent>
</SfDropDownButton>
<SfDialog ShowCloseIcon="true" IsModal="true" @bind-Visible="@IsVisible"></SfDialog>
@code {
protected SfMenu<MenuItem>? HamburgerMenuObj { get; set; }
protected bool IsVisible;
protected async Task MenuOpened()
{
await HamburgerMenuObj.OpenAsync();
}
protected async Task MenuItemSelected(MenuEventArgs<MenuItem> args)
{
IsVisible = true;
if (HamburgerMenuObj is not null) await HamburgerMenuObj.CloseAsync();
}
}
<style>
.e-menu-container.e-hamburger .e-menu-header:not(.e-vertical) {
display: none;
}
.e-menu-container.e-hamburger {
width: 300px;
}
</style>
Hi Dave,
We have checked your reported query and to resolve this issue, kindly use the below code snippet.
protected async Task MenuItemSelected(MenuEventArgs<MenuItem> args) { IsVisible = true; if (HamburgerMenuObj is not null) await HamburgerMenuObj.CloseAsync(); DropdownBtnObj.Toggle(); } |
The Dropdown Button popup not closed properly in your sample, using the Toggle method of Dropdown Button we can close the dropdown popup along with the menu component.
Check with attached sample code file and get back to use if you need any further assistance on this.
Regards,
YuvanShankar A
That solved the problem. Thank you for your help.
You are welcome, Dave. Please get back to us if you need any further assistance on this.
If that post is helpful, please consider accepting it as the solution so that other members can locate it more quickly.