-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Add more special-case event types #5501
Comments
@rynowak Can you please also add "mouseenter" and "mouseleave"? |
This looks like the ideal case to have a tool (possibly as a build step) that takes that TypeScript and builds some C# we can include in Blazor. |
Some progress here: https://github.com/mono/TsToCSharp |
Note that we made some more progress here, adding the details of:
|
@rynowak Do you anticipate we'll do more event types in 0.4.0, or should we move this issue out to backlog now that the bulk are covered? |
I think we should backlog this. We can add more as we get feedback or as folks are willing to send PRs. |
Having a Sender in the EventArgs would be very useful. Is this something that is being considered? |
What value should be supplied for "Sender"? We haven't done it only because it's not clear what that would even mean. Instead, the normal way to track who's calling an event handler is to use a lambda to call it, e.g.:
|
I would expect |
What would you then do with the |
@SteveSandersonMS I can be wrong but I believe that the lamda doesn't cover all the cases. For example the one we're currently having in Blazorstrap : chanan/BlazorStrap#7 The issue is with onblur or onfocusout for a dropdown component. The use case in short: I don't really see an alternative at the moment. |
@rynowak |
Would it be possible to add extension points that make custom events available? |
I landed here looking for a way to add the transitionend event to an element, but I only could find the list of "natively"supported events and that "arbitrary events" are being worked on. How is the state on this? Is the only way to bind to unsupported events by using JSInterop? |
As @miroslavp mentioned: |
We'll be covering this as part of #17552 |
We need to add support for more kinds of strongly typed events to the Blazor library, and then add more mappings for tooling support.
We're considering these lists of event types as a starting point for what we want to include as first class events.
https://github.com/Microsoft/TypeScript/blob/master/lib/lib.dom.d.ts#L3475
https://github.com/Microsoft/TypeScript/blob/master/lib/lib.dom.d.ts#L5472
First, we're eliminating anything that is vendor specific. That's all of the stuff with
MS
orwebkit
. This items tracks our progress as well as future work. Note that you aren't blocked for using these events just because we haven't added them. This just makes it a little nicer.In 0.3 we've added the basic plumbing for these events as well as defined new
UIEventArgs
-derived classes where needed. However we didn't try to add all of the relevant data to these classes. If you look at an example like https://github.com/aspnet/Blazor/blob/dev/src/Microsoft.AspNetCore.Blazor/UIEventArgs.cs#L32 - we don't include thedataType
anddata
- https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent/ClipboardEventWe'd be super interested in contributions to help fill out these data types as well as to add tests where they are missing and possible to add.
Note also that in 0.3 the path has been cleared for you to handle arbitrary events as long as you don't need to pass any data through the event.
Added in 0.3:
The text was updated successfully, but these errors were encountered: