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
Is your feature request related to a problem? Please describe the problem.
In blazor, when you add the draggable attribute using a boolean value, it produces markup with just the text draggable. For example
<divdraggable="@MyBool">Am I really draggable</div>
@code{publicboolMyBool{get; set}}
Will produce this output <div draggable>Am I really draggable</div>.
This causes problems in browsers (such as chrome) as they seem to require a value for the draggable attribute, true or false. With the output blazor produces in this situation the browser sometimes allows for dragging and other times does not. It's not clear to me exactly how the browser is behaving but it is spotty and broken at best.
Describe the solution you'd like
for this particular attribute I would like blazor to output the true or false value as the attribute value. For example:
<divdraggable="@false">I am not draggable</div>
<divdraggable="@true">I am draggable</div>
would produce this markup
<divdraggable="false">I am not draggable</div><divdraggable="true">I am draggable</div>
Additional context
You can work around this behavior by calling .ToString() on your bool, and the current behavior is the documented and expected behavior of blazor. However; if a dev makes the mistake of setting the draggable attribute to a bool value (like my colleague did) it is not clear why the drag/drop functionality is broken and hours can be wasted trying to solve the issue.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
In blazor, when you add the
draggable
attribute using a boolean value, it produces markup with just the textdraggable
. For exampleWill produce this output
<div draggable>Am I really draggable</div>
.This causes problems in browsers (such as chrome) as they seem to require a value for the draggable attribute,
true
orfalse
. With the output blazor produces in this situation the browser sometimes allows for dragging and other times does not. It's not clear to me exactly how the browser is behaving but it is spotty and broken at best.Describe the solution you'd like
for this particular attribute I would like blazor to output the
true
orfalse
value as the attribute value. For example:would produce this markup
Additional context
You can work around this behavior by calling
.ToString()
on your bool, and the current behavior is the documented and expected behavior of blazor. However; if a dev makes the mistake of setting thedraggable
attribute to a bool value (like my colleague did) it is not clear why the drag/drop functionality is broken and hours can be wasted trying to solve the issue.The text was updated successfully, but these errors were encountered: