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

Blazor InputSelect Errors with "multiple" attribute #19776

Closed
mrlife opened this issue Mar 11, 2020 · 2 comments
Closed

Blazor InputSelect Errors with "multiple" attribute #19776

mrlife opened this issue Mar 11, 2020 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@mrlife
Copy link
Contributor

mrlife commented Mar 11, 2020

Describe the bug

When adding multiple to an InputSelect input component, running the app, and selecting an item, an error occurs and is displayed in the browser console.

Is multiple supported?

To Reproduce

Search.razor

<InputSelect class="custom-select" @bind-Value="_myModel.SelectedNumbers" id="numbers" multiple>
	<option value="">Select number ...</option>
	<option value="1">One</option>
	<option value="2">Two</option>
</InputSelect>

Search.razor.cs

public IEnumerable<string> UnitIds { get; set; }

Error

Error: System.InvalidOperationException: Microsoft.AspNetCore.Components.Forms.InputSelect1[System.Collections.Generic.IEnumerable1[System.String]] does not support the type 'System.Collections.Generic.IEnumerable1[System.String]'. at Microsoft.AspNetCore.Components.Forms.InputSelect1.TryParseValueFromString(String value, TValue& result, String& validationErrorMessage)
at Microsoft.AspNetCore.Components.Forms.InputBase1.set_CurrentValueAsString(String value) at Microsoft.AspNetCore.Components.Forms.InputSelect1.b__4_0(String __value)
at Microsoft.AspNetCore.Components.EventCallbackFactoryBinderExtensions.<>c__DisplayClass22_0`1.b__0(ChangeEventArgs e)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)

Further technical details

  • ASP.NET Core version: 3.1.2
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and it's version: VS Mac 8.5 Preview (8.5 build 3129)
  • $ dotnet --info

.NET Core SDK (reflecting any global.json):
Version: 3.1.102
Commit: 573d158fea

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/3.1.102/

Host (useful for support):
Version: 3.1.2
Commit: 916b5cba26

.NET Core SDKs installed:
3.1.102 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

@Pilchie Pilchie added the area-blazor Includes: Blazor, Razor Components label Mar 11, 2020
@SteveSandersonMS
Copy link
Member

It's not currently supported. This is tracked by #5519, so closing as duplicate.

@SteveSandersonMS SteveSandersonMS added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Mar 12, 2020
@ghost ghost added the Status: Resolved label Mar 12, 2020
@mrlife
Copy link
Contributor Author

mrlife commented Mar 12, 2020

@SteveSandersonMS I see, thank you. The #5519 hasn't been updated with a status for almost 2 years. Possible to provide an update there?

@ghost ghost locked as resolved and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

3 participants