Skip to content

DataGrid: Fix editing of nullable values such as int?#8231

Merged
ScarletKuro merged 1 commit intoMudBlazor:devfrom
snakex64:Fix-DataGrid-editing-nullable
Feb 24, 2024
Merged

DataGrid: Fix editing of nullable values such as int?#8231
ScarletKuro merged 1 commit intoMudBlazor:devfrom
snakex64:Fix-DataGrid-editing-nullable

Conversation

@snakex64
Copy link
Contributor

Description

This fix a bug with the datagrid where it was impossible to clear a value for nullable structs such as int?, double?, etc.
We could set a value, ex "25" but then if we clear the text "25" and hit "enter" there was a crash.
Try emptying the "Age" cell in one of the row: https://try.mudblazor.com/snippet/ckwoYmmoLvDaySwa

How Has This Been Tested?

Tested using a small example and added a unit test

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added bug Unexpected behavior or functionality not working as intended PR: needs review labels Feb 24, 2024
@snakex64 snakex64 changed the title Fix the editing of nullable values such as int? in the datagrid DataGrid: Fix editing of nullable values such as int? Feb 24, 2024
@codecov
Copy link

codecov bot commented Feb 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.23%. Comparing base (ec8d3c6) to head (4e5445c).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #8231   +/-   ##
=======================================
  Coverage   88.23%   88.23%           
=======================================
  Files         394      394           
  Lines       11765    11767    +2     
  Branches     2384     2385    +1     
=======================================
+ Hits        10381    10383    +2     
  Misses        857      857           
  Partials      527      527           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ScarletKuro ScarletKuro merged commit 0366de5 into MudBlazor:dev Feb 24, 2024
@ScarletKuro
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants