-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix(module: modal): throw error when using ModalService if not set ModalOptions.AfterClose (#807) #809
Conversation
…lazor#807) If ModalOptions.AfterClose is null, the exception will be thrown: delegate to an instance method cannot have null 'this'
Codecov Report
@@ Coverage Diff @@
## master #809 +/- ##
=========================================
- Coverage 3.66% 3.66% -0.01%
=========================================
Files 395 395
Lines 17515 17518 +3
=========================================
Hits 642 642
- Misses 16873 16876 +3
Continue to review full report at Codecov.
|
@@ -31,6 +31,11 @@ public class ModalOptions | |||
|
|||
public Func<Task> AfterClose { get; set; } | |||
|
|||
internal Func<Task> GetAfterClose() |
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.
用自动属性或者直接赋值 AfterClose ?? (() => Task.CompletedTask)
性能高一点,不然每次渲染都要执行方法
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.
LGTM
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
#807
💡 Background and solution
📝 Changelog
☑️ Self Check before Merge