-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Add support for int
for the <InputSelect>
component
#18305
Comments
@giorgi-abashidze thanks for contacting us. In order for us to be able to investigate this issue. Could you provide a minimal repro project that shows the problem and detailed steps on how to reproduce it? |
@javiercn here is the demo project https://github.com/giorgi-abashidze/InputSelect-Test-For-int The field name for test is BrandId created new test project and now i'm getting error in console: inputselect not suporting type Int32. |
int
for the <InputSelect>
component
Just to be clear, to handle real world scenarios, the InputSelect needs to handle both int and Guid, as well as the nullable versions of each. Not just 'int'. Options values sourced from a database are almost always going to have int or Guid keys. The input model being bound to may or may not require the user to make a choice from the list, so the nullable variants are appropriate for that situation. In its current state, InputSelect out of the box is unusable in many real world scenarios, where int and Guid dominate. |
Supporting |
Closing as this was fixed as part of #23415. |
@MackinnonBuck Is this a 5.0 only release? |
.NET Standard 2.1 webassembly app, i have problem validating int field, in more details i have list of items in inputselect and their Ids into
<option value="@item.Id">
i have [Required] Data anotation in this field in model class but still not care, onvalidsubmit method is calling even if
<optionvalue="">
is selected,i tried to add another data anotation to the field greater than zero
[Range(0, Int32.MaxValue, ErrorMessage = "Parent id is Required")]
and replaced default select option ->
<option value="" selected>
with<option value="0" selected>
still not works.
update:
validation is working fine. problem is binding. @bind-Value not changing the fields value, I added default value 0 to the field and it showing error now, but when select other item, field value not updating and showing the same error.
The text was updated successfully, but these errors were encountered: