Why @ref or ElementReference always has a value after first set value into it and when it does not rendered throw an exception? #56250
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Answered
Resolved because the question asked by the original author has been answered.
question
Status: Resolved
Is there an existing issue for this?
Describe the bug
As you can see in the following code @ref here which is a InputText component after first render always has value even when I don't want render it in the page
Expected Behavior
I expect Element.HasValue will be false when it does not rendered in the page
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
8.0.0.2
Anything else?
No response
The text was updated successfully, but these errors were encountered: