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

MatAutocomplete does not play nice with EditForm #278

Closed
Raveen87 opened this issue Oct 2, 2019 · 5 comments
Closed

MatAutocomplete does not play nice with EditForm #278

Raveen87 opened this issue Oct 2, 2019 · 5 comments

Comments

@Raveen87
Copy link

Raveen87 commented Oct 2, 2019

Placing a MatAutocomplete in an EditForm produces a weird error message for me.

The error message I'm getting is this: InvalidOperationException: MatBlazor.MatTextField requires a value for the 'ValueExpression' parameter. Normally this is provided automatically when using 'bind-Value'.

I'm able to reproduce it with this example:

@page "/"

<EditForm Model="selected">
	<MatAutocomplete Collection="@options" ItemType="string" Label="Pick one" @bind-Value="selected"></MatAutocomplete>
</EditForm>

<p>Selected: @selected</p>

@code
{
	private string selected = String.Empty;

	string[] options = new[]
	{
		"One",
		"Two",
		"Three"
	};
}

Placing the MatAutocomplete outside of the EditForm works. So does using for instance an InputText instead of a MatAutocomplete inside the EditForm like this:

<EditForm Model="selected">
	<InputText placeholder="Type something" @bind-Value="selected" />
</EditForm>

I'm using MatBlazor 1.9.0 and .NET Core 3.0.

@nguyenvanbien95
Copy link

I have the same problem. Have anyone available hot solution for that?

@bnemetchek
Copy link

Try this: #213 (comment)

@katiep23
Copy link

@sandrohanea
Copy link
Contributor

Hi!
The issues with the EditForm should be fixed after the merge of #548.

@enkodellc
Copy link
Collaborator

Merged fix into develop branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants