Repository navigation
Open
Labels
Pillar: Dev ExperiencePriority:3Work that is nice to haveaffected-fewThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-component-modelAny feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc)feature-renderingFeatures dealing with how blazor renders componentsseverity-minorThis label is used by an internal tool
Milestone
Description
With regards to this PR: #23221
Instead of assuming an empty string and null are the same for an input,...
Would it be possible to set a marker attribute on the when we try to set the value to @null, and in the Blazor code detect that and use null for the @onchange event and binding?
<option value=@null>Select one... </option>
Would generate something like
<option bl_somethingunique>Select one... </>
Due to HTML limitations we wouldn't be able to have an empty string and a null as available values in the same select, but at least the C# developer won't have to write some code to convert "" to null, and it will "just work".
Reacted by Ben Sampica, Jan Paolo Go, NetherGranite, Michel Jansson, pavlexander, Kevin, Bouke Haarsma, Denys, Oblomoff, Kevin Gates and 4 more
Reacted by Steven T. Cramer, Brett, Oleksandr Liakhevych, pavlexander, Kevin Gates and David Clough
Metadata
Metadata
Assignees
Labels
Pillar: Dev ExperiencePriority:3Work that is nice to haveaffected-fewThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-component-modelAny feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc)feature-renderingFeatures dealing with how blazor renders componentsseverity-minorThis label is used by an internal tool
Activity
mkArtakMSFT commentedon Jul 15, 2020
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
2 remaining items
Deadvi5 commentedon Jan 9, 2024
We've encountered this "issue". I'm commenting just to show interest in this and to get notifications 😄
linuspetrucci commentedon Dec 12, 2025
I recently ran into a situation where this would have been very handy. I am definetly interested in this feature.
kgar commentedon Sep 15, 2026
My team works on a forms-heavy family of enterprise applications, so this comes up every now and then. When a field is required, we've resorted to using the RequiredAttribute option
AllowEmptyStrings = false. It would be a nice-to-have, for sure.