havit / Havit.Blazor

Free Bootstrap 5 components for ASP.NET Blazor + optional enterprise-level stack for Blazor development (gRPC code-first, layered architecture, localization, auth, ...)
https://havit.blazor.eu
MIT License
475 stars 66 forks source link

[All Form Controls] Cannot set event propagation #722

Open robertmclaws opened 8 months ago

robertmclaws commented 8 months ago

I'm using Havit controls inside Blazor.Diagrams, and I would like clicking on a textbox to not move around the diagram nodes (as what currently happens in their demo in the header, which is not using your controls).

(To reproduce, click and hold in one of the textboxes to edit the text, but move your mouse around instead. That's not supposed to happen.)

The problem is I cannot set the following properties on your controls, specifically HxSwitch andHxInputText:

@onmousedown:stopPropagation
@onmousemove:stopPropagation
@onmousewheel:stopPropagation

Can you folks please implement this pattern in your controls? Thanks!

hakenr commented 8 months ago

This is a frequent challenge encountered when transitioning from plain HTML elements to Razor components, and unfortunately, there isn't a simple obvious solution. Have you come across any noteworthy implementations so far? See https://github.com/dotnet/aspnetcore/issues/20560

For some common scenarios we added an explicit parameter, such as HxButton.OnClickStopPropagation="true|false", but this is not applicable everywhere.