-
-
Notifications
You must be signed in to change notification settings - Fork 362
fix(SelectCity): reset Value after update IsMultiple parameter #6942
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,4 +19,12 @@ public partial class SelectCities | |||||||||||||||||||||||
| private bool _isDisabled = false; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| private bool _autoClose = true; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| private Task OnValueChagned(bool v) | ||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (typo): Typo in method name: 'OnValueChagned' should be 'OnValueChanged'. Please rename the method to 'OnValueChanged' for clarity and consistency. Suggested implementation: private Task OnValueChanged(bool v)
{
_value = "";
_isMultiple = v;
StateHasChanged();
return Task.CompletedTask;
}
}If this method is referenced elsewhere in the file or project (e.g., in the .razor markup or other C# code), those references should also be updated to use
|
||||||||||||||||||||||||
| private Task OnValueChagned(bool v) | |
| private Task OnValueChanged(bool v) |
Copilot
AI
Oct 18, 2025
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.
Calling StateHasChanged inside an event callback is generally unnecessary because Blazor re-renders after handling the event; consider removing this call.
| StateHasChanged(); |
Copilot
AI
Oct 18, 2025
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.
Since the handler does not perform asynchronous work, prefer a void-returning signature to avoid allocating Task.CompletedTask and simplify the method; e.g., change to 'private void OnValueChanged(bool isMultiple)'.
| private Task OnValueChagned(bool v) | |
| { | |
| _value = ""; | |
| _isMultiple = v; | |
| StateHasChanged(); | |
| return Task.CompletedTask; | |
| private void OnValueChagned(bool v) | |
| { | |
| _value = ""; | |
| _isMultiple = v; | |
| 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.
Typo in handler reference: update to OnValueChanged to match the corrected method name.