radzenhq / radzen-blazor

Radzen Blazor is a set of 90+ free native Blazor UI components packed with DataGrid, Scheduler, Charts and robust theming including Material design and FluentUI.
https://www.radzen.com
MIT License
3.52k stars 785 forks source link

Double component parameter names should be allow with additional properties #1601

Closed kensleebos closed 3 months ago

kensleebos commented 3 months ago

Describe the bug When using event parameters like dragover in Radzen, adding attributes such as @dragover:preventDefault="true" or @dragover:stopPropagation="true" should be possible. However, this results in an RZ10010 error.

To Reproduce Steps to reproduce the behavior: Create a new Radzen Blazor project. Add a radzen component that handles the dragover event. Attempt to use @dragover:preventDefault="true" or @dragover:stopPropagation="true" in the component. Observe the RZ10010 error.

Expected behavior The component should allow the use of @dragover:preventDefault="true" and @dragover:stopPropagation="true" without throwing an RZ10010 error. The parameters should be passed down.

Additional context <RadzenDataGrid @ondragover="OnDragOver" @ondragover:preventDefault="true" @ondragover:stopPropagation="true"> Drag over me

@code { private void OnDragOver(DragEventArgs e) { // Handle dragover event } }

enchev commented 3 months ago

I've just tested this on our demos and it compiles normally: dg-drag

kensleebos commented 3 months ago

The error occurs within visual studio:

image

when i run the application without the preventdefault it compiles fine, i can even add it while running and hot reload it. That also works but during original compile it gives that error. The error doesn't occur when adding the same attributes to a normal div.

i'm using radzen version: 4.34.1

enchev commented 3 months ago

Looks like this is something related to any Blazor component not specific to Radzen.Blazor:

<NavLink @ondragover="OnDragOver" @ondragover:preventDefault="true" @ondragover:stopPropagation="true">
</NavLink>

@code {
    private void OnDragOver(DragEventArgs e)
    {
        // Handle dragover event
    }
}

image

https://github.com/dotnet/aspnetcore/issues/18460

I'm afraid that we cannot do anything about this.