CodeBeam.MudBlazor.Extensions
CodeBeam.MudBlazor.Extensions copied to clipboard
MudSelectExtended Text Binding Issue (6.9.2)
We have a heavy custom component that we're using the styling for the MudSelectExtended (input field) and are implementing the dropdown using DevExpress (specifically, the list box). We ran into a weird... Data binding issue with the text property specifically. This may not be a MudExtensions issue, could be MudBlazor, but wanted to start here.
The issue came up with something strange: on render, the input would be set correctly, then set to an empty string - but on hover, the input field would then display the correct text, and would stay that way. It would not revert back to an empty string - it showed the correct value after that point. Here's it in action:
We were setting the Text property one way, when we realized - oops - we should probably do two way binding. We added @bind-Text="_displayText" and it completely stopped working - never showed the correct text - didn't show it on hover. No reason to show an example here, it just shows nothing in the input field!
The thing that really makes this confusing... We went to go see what the textchanged event was spitting out, so I added this as a debug line:
TextChanged="@((e) => Console.WriteLine($"Callback from text changed: {e}"))"
And... It works now. The text shows the correct value, doesn't get set back to an empty string, and obviously persists even on hover. The thing that makes this even more confusing, is what the log is showing:
Callback from text changed:
Callback from text changed:
Callback from text changed:
Callback from text changed:
Callback from text changed:
Callback from text changed:
Callback from text changed:
Callback from text changed:
Callback from text changed:
Callback from text changed:
Callback from text changed:
Very strange as it's acting as if there is no string being pass through the event callback.
Please let me know if any other information is needed to reproduce. I'm happy to provide whatever is necessary!