Skip to content
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

Splitbutton Click nulllability issues with RadzenSplitButtonItem #1583

Open
NEmbgen opened this issue Jul 8, 2024 · 3 comments
Open

Splitbutton Click nulllability issues with RadzenSplitButtonItem #1583

NEmbgen opened this issue Jul 8, 2024 · 3 comments

Comments

@NEmbgen
Copy link

NEmbgen commented Jul 8, 2024

Describe the bug

Using the SplitButton component creates an IDE issue with nullability checks, as the EventCallback for Click (here) suggests it returns a non-nullable RadzenSplitButtonItem. If the main Button is clicked however null is returned (here)

This creates an issue where you need to do a null check but your IDE is warning you about an unnecessary null check.

To Reproduce

  • Create a splitbutton and an event callback for Click
  • The event callback will have the signature public void OnClick(RadzenSplitButtonItem item)
  • In the event callback access item.Value
  • Click the main part of the button (not the dropdown)

Expected behavior
Return a nullable RadzenSplitButtonItem via RadzenSplitButtonItem?

@akorchev
Copy link
Collaborator

akorchev commented Jul 8, 2024

Hi @NEmbgen,

You can add the ? yourself.

@NEmbgen
Copy link
Author

NEmbgen commented Jul 8, 2024

@akorchev Thanks for the response. I know I can add it myself, but wouldn't it be more correct from an API point of view for Radzen to have it?

@akorchev
Copy link
Collaborator

akorchev commented Jul 8, 2024

Currently null checks are not enabled for the Radzen.Blazor project. Enabling them would require a huge effort which we are not willing to make at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants