diff --git a/src/Core/Components/Anchor/FluentAnchor.razor.cs b/src/Core/Components/Anchor/FluentAnchor.razor.cs index 145ac0b4e2..1c08d0c96c 100644 --- a/src/Core/Components/Anchor/FluentAnchor.razor.cs +++ b/src/Core/Components/Anchor/FluentAnchor.razor.cs @@ -51,7 +51,7 @@ public partial class FluentAnchor : FluentComponentBase, IAsyncDisposable public string? Rel { get; set; } /// - /// Gets or sets the target attribute that specifies where to open the link, if Href is specified. + /// Gets or sets the target attribute that specifies where to open the link, if Href is specified. /// Possible values: _blank | _self | _parent | _top. /// [Parameter] @@ -82,6 +82,9 @@ public partial class FluentAnchor : FluentComponentBase, IAsyncDisposable [Parameter] public Icon? IconEnd { get; set; } + [Parameter] + public EventCallback OnClick { get; set; } + /// /// Gets or sets the content to be rendered inside the component. /// @@ -132,6 +135,10 @@ private async Task OnClickAsync() // If the target ID has been specified, we know this is an anchor link that we need to scroll to await _jsModule.InvokeVoidAsync("scrollIntoView", _targetId); } + if (OnClick.HasDelegate) + { + await OnClick.InvokeAsync(); + } } ///