-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Blazor: add support for onclose event #50721
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
Conversation
|
Thanks for your PR, @campersau. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
| void OnClose(EventArgs e) | ||
| { | ||
| message += "onclose,"; | ||
| StateHasChanged(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call shouldn't be needed, since the event dispatcher causes the equivalent to StateHasChanged implicitly anyway. Would be good to update this file so that the tests validate it works without explicitly calling this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just going to remove it now, because if it works and the tests pass, we can still merge this in time for .NET 8. If it misses the end-of-day deadline today, it will slip into .NET 9!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just copied it from the ToggleEventComponent maybe there are more unnecessary StateHasChanged in other test components as well.
src/Components/test/testassets/BasicTestApp/CloseEventComponent.razor
Outdated
Show resolved
Hide resolved
Ideally yes |
|
I'll get this finalized in time for .NET 8, so need to close this PR in favor of #50727. Your commit will be preserved, though. |
Should I add it as well or are you going to add it in the other PR? When you add both |
|
Hi @campersau. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
I've added it in #50727 |
Add support for onclose event
Similar to #24036
Description
Reference: https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/close_event
There is also a
cancelevent for<dialog>, should it be added as well?Fixes #50513