-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Showing offset x and y for mouseeventargs #22127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
How would somebody figure out the relative position? For the example, i saw the x position was 329 but the width and height was 300. That means if you wanted to know what position relative to that div, i know that javascript has offset x and y but that is not put into the MouseEventArgs. |
@musictopia2 You can use JS interop to gather the element position and then you can use the delta between the client space to figure out the element mouse position offset. You only need to call the interop once to obtain the position of the element, and then you can bind this logic to events such as window resizing to update this thus bypassing performance concerns within the mouse move event. I have done some digging and it would appear that the |
I also need this and actually the first thing I checked after the recent releases. Apparently, this is only available if targeting .NET 5.0.0-preview.4. |
When I installed .NET 5 preview4 and changed the |
.NET 5.0 preview4 currently doesnt support Blazor WASM #22208 |
This is going to be fixed in .NET 5.0 and the change has already been merged. |
I need the ability to show the x and y coordinates of the element being used on and not just the x and y relative to the entire window. I know in javascript, there is the ability of showing that. However, it would be too slow the javascript has to constantly communicate with the c# to give it that information.
The text was updated successfully, but these errors were encountered: