radzenhq / radzen-blazor

Radzen Blazor is a set of 90+ free native Blazor UI components packed with DataGrid, Scheduler, Charts and robust theming including Material design and FluentUI.
https://www.radzen.com
MIT License
3.53k stars 789 forks source link

Splitbutton Click nulllability issues with RadzenSplitButtonItem #1583

Open NEmbgen opened 3 months ago

NEmbgen commented 3 months ago

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

Expected behavior Return a nullable RadzenSplitButtonItem via RadzenSplitButtonItem?

akorchev commented 3 months ago

Hi @NEmbgen,

You can add the ? yourself.

NEmbgen commented 3 months ago

@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 commented 3 months ago

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.