🐛 Bug Report
The @bind-SelectedItems:after and @bind-SelectedItem:after callbacks are executed twice in FluentAutocomplete when you select an item.
💻 Repro or Code Sample
<div>
Current count: <span data-testid="current-value">@countAfter</span>
</div>
<FluentAutocomplete TValue="string"
TOption="string"
Label="Test"
Items="Options"
@bind-SelectedItems="SelectedItems"
@bind-SelectedItems:after="AfterChanged" />
@code
{
string test = string.Empty;
int countAfter = 0;
IEnumerable<string> SelectedItems { get; set; } = [];
void AfterChanged()
{
countAfter++;
}
List<string> Options = new List<string>
{
"Option 1",
"Option 2",
"Option 3",
"Option 4",
"Option 5"
};
}
- Run the code
- Click on the component
- Select an item
- See count is 2 instead of 1
🤔 Expected Behavior
I expect the method to be executed once.
😯 Current Behavior
I expect the method will be executed twice.
💁 Possible Solution
🔦 Context
I created this PR with an integration test for this case #4753
For some reason if you try to validate it in the normal unit tests the count will always be 1.
🌍 Your Environment
- OS & Device: Windows 11 64 Bit
- Browser latest Firefox Chrome & Edge
- latest dev-v5 branch
🐛 Bug Report
The
@bind-SelectedItems:afterand@bind-SelectedItem:aftercallbacks are executed twice inFluentAutocompletewhen you select an item.💻 Repro or Code Sample
🤔 Expected Behavior
I expect the method to be executed once.
😯 Current Behavior
I expect the method will be executed twice.
💁 Possible Solution
🔦 Context
I created this PR with an integration test for this case #4753
For some reason if you try to validate it in the normal unit tests the count will always be 1.
🌍 Your Environment