Blazorise icon indicating copy to clipboard operation
Blazorise copied to clipboard

SelectList not executing the callback set for SelectedValueChanged

Open baltazarO opened this issue 2 weeks ago • 2 comments

Blazorise Version

1.5.3

What Blazorise provider are you running on?

None

Link to minimal reproduction or a simple code snippet

<SelectList DefaultItemDisabled DefaultItemHidden=true DefaultItemText="Pick a data type" TItem="DataType" Data="Foo.DataTypes" TValue="int" ValueField="@((x) => x.ID)" TextField="@((x) => x.NameOfType)" SelectedValue="Foo.Bar.DataTypeID" SelectedValueChanged="(e) => TheDataTypeChanged(e)"/>

void TheDataTypeChanged(int newValue) { Foo.Bar.DataTypeID = newValue; Foo.CallStateHasChanged(); }

Steps to reproduce

  1. Set a breakpoint in the "TheDataTypeChanged" method
  2. First you need to create a class called Foo that has a list of datatypes and a Bar object that is = new Bar();
  3. Make sure datatypes is initialized (DataType class has an ID and a Name)
  4. Choose a datatype from the select list dropdown

What is expected?

I should hit the breakpoint in the "TheDataTypeChanged" method

What is actually happening?

Never hits the breakpoint.

What browsers do you see the problem on?

Chrome

Any additional comments?

No response

baltazarO avatar Jun 26 '24 22:06 baltazarO