question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MudSelect: Changing the bound Value does not fire SelectedValuesChanged event and does not perform required check

See original GitHub issue

Bug type

Component

Component name

MudSelect

What happened?

There is a list of strings in a MudSelect. If I change the value of the variable bound to MudSelect, the value is changed but the SelectedValuesChanged event is not fired and also the required check is not executed.

Expected behavior

SelectedValuesChanged event is fired and the required check is performed.

If I use the MudSelect<T>.SelectOption() method based on the reference to the MudSelect, the SelectedValuesChanged event is fired and the Required check is also performed.

Reproduction link

https://try.mudblazor.com/snippet/cOQbujGLxTJQqiiD

Reproduction steps

  1. Select a value by Button “Select this Item by binded value” => No Event Fired Messge appears.
  2. Clear the select field => The Required-Check is performed and the Event Fired Message is displayed.
  3. use the button “Select this Item by binded value” on more time => No Event Fired Messge appears. => The Field is still marked as required. The Required-Error-Message is displayed
  4. Using the Button “Select this Item by ref-Object” sets the value to the selected one and the Event Fired Message is displayed.

Relevant log output

Nothing

Version (bug)

v.5.1.4

Version (working)

No response

What browsers are you seeing the problem on?

Firefox

On what operating system are you experiencing the issue?

Windows

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
sanepetecommented, Apr 9, 2022

Changing the bound-Value

0reactions
henoncommented, Sep 5, 2022

@MooWeek Does it annoy you enough so you maybe try to fix it and PR?

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Which event in a MudBlazor MudSelect is called when ...
1 Answer. You can use ValueChanged event callback which is fired when the Value property changes.
Read more >
MudSelect<T> API
Name Type Default SelectedValues IEnumerable Text string null Value T null
Read more >
How to handle the ValueChanged event and use forms and ...
Handling the ValueChanged event exposed from inputs interferes with two-way binding through @bind-Value and thus, with validation.
Read more >
Need help with MudSelect MudBlazor (comparison ...
My new go to is Mud because it's native and clean. But may not be to everyone's taste.
Read more >
MudBlazor simple syntax various errors in Cascade ...
When using @bind-Value you do not use Value= or ValueChanged= ... when the value changed if I remove the ValueChanged event, or I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found