chanan / BlazorStrap

Bootstrap 4 Components for Blazor Framework
https://blazorstrap.io
The Unlicense
911 stars 156 forks source link

Ignore duplicate calls to show/hide #529

Closed uecasm closed 2 years ago

uecasm commented 2 years ago

This successfully works around the problem mentioned in #528, but perhaps does not solve their underlying causes.

For whatever reason it looks like a single click on a BSToggle resulted in two calls to ShowActionsAsync (and the same on hiding), and that consequently two calls to AddDocumentEventAsync were made without unregistering in between, which appeared to get the event registration "stuck on" (even though more than two calls to remove it also happened, it was not actually removed).

This change doesn't prevent the multiple calls from happening, but it does ignore the second one.