Blazorise
Blazorise copied to clipboard
BarToggler Clicked only fired every second time when visibility is set to true
Describe the bug BarToggler Clicked only fired every second time when visibility is set to true. This leads to confusing and non functional functionality on the click event, example: You want to do something on show/hiding changes. This only happend in mobile mode.
To Reproduce Steps to reproduce the behavior:
<BarToggler Clicked="@(_ =>Console.WriteLine("Called"))"/>
Switch into mobile view in dev console in the browser (device emulation). We start with a collapsed menu, first click to open it will output: Called, second click nothing, third click called, fourth nothing...
Expected behavior The Clicked event is execute every time.
I'm at the moment debugging, and I can confirm the same problem on my side. What I found strange is that @onclick
inside of BarToggler is executed every time. But for some reason, when it invokes await Clicked.InvokeAsync();
the Clicked
event is non existant. As if Blazor somehow removes it between states.