You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is about conditional attribute rendering where sometimes null value attributes are unexpectedly rendered. I stumbled upon this today during work in a asp.net core mvc 7 application (and VS 2022), and it took me a while to nail down the behavior. I haven't found any documentation or issues stating whether this is a bug, as designed, or otherwise.
When rendering something like <div @(something) style="@null">, then you would expect the style attribute not to be output in the final html. But in my testing that is not the case. But, if you place the @(something) behind the style attribute, then the style attribute is omitted as expected. Below is a more thorough test:
This issue is about conditional attribute rendering where sometimes null value attributes are unexpectedly rendered. I stumbled upon this today during work in a asp.net core mvc 7 application (and VS 2022), and it took me a while to nail down the behavior. I haven't found any documentation or issues stating whether this is a bug, as designed, or otherwise.
When rendering something like
<div @(something) style="@null">
, then you would expect the style attribute not to be output in the final html. But in my testing that is not the case. But, if you place the @(something) behind the style attribute, then the style attribute is omitted as expected. Below is a more thorough test:I expected all the div elements with name="fails-*" to not output the empty styles attribute, but here's the actual output:
The text was updated successfully, but these errors were encountered: