SamProf / MatBlazor

Material Design components for Blazor and Razor Components

Home Page:http://www.matblazor.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MatSelectItem/MatSelectValue throws error when setting value to null if there is no null value in the list

Afroshar opened this issue · comments

In my app I want to clear MatSelectItem's value at a certain point. It seems to be working fine overall but produces an error "Uncaught (in promise) Error: System.FormatException: Input string was not in a correct format." which can be seen in browser console.
If select's item list has a null in it then setting value to null doesn't produce any errors.

fiddle: https://blazorfiddle.com/s/ag51h60a
Pressing "Clear" on the first select will produce an error.

Looks like it's throwing the same error every time when component render is triggered and select's value is null (try clearing first select in the fiddle and pressing StateHasChanged() button).