Skip to content

How to close a menu outside it #54810

Answered by mayur-ekbote
xcaptain asked this question in Q&A
Discussion options

You must be logged in to vote

There is no direct solution in Blazor. You have only two options:

  1. Implement the JS functionality upon opening the menu. It would require you to use JSInterop
  2. Show the menu on a fixed backdrop modal. Add the closing logic in the @OnClick event of the backdrop

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@xcaptain
Comment options

@xcaptain
Comment options

@xcaptain
Comment options

Answer selected by xcaptain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area-blazor Includes: Blazor, Razor Components
3 participants