Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Identify if a Blazor component has an @OnClick event set

$
0
0

Is it possible in a Blazor razor page within my code to identify if the @onclick event has been setup as an attribute?

I have an Info Component that displays an icon and a tooltip. I have the ability to click on the icon and copy to the clipboard the text in the tooltip. But sometimes, I use the same thing as a button with the @onclick event. I do not want to show the copy text in the tooltip as well as not running the click event.

I need to be able to identify if the component has an @onclick event setup and if so, I need to set a property to false to not allow the copying of the tooltip to the clipboard.

I have the ability to set the property to false as a parameter, but I want to add a double check to not allow this if there is an @onclick already registered.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>