-
-
Notifications
You must be signed in to change notification settings - Fork 539
Labels
Type: Feature ⚙Request or idea for a new feature.Request or idea for a new feature.
Milestone
Description
Is your feature request related to a problem? Please describe.
I want to be able to set a fallback img when loading of an image fails, eg on 404. In html you can do this by setting the onerror attribute. Currently In my own code I need to interpolate strings to be able to build the onerror attribute. Would be nice if Blazorise can do this for me.
Current onerror building
<Image Source="@ProfilePicture" onerror="@m_fallbackPicture" />
@code {
private string m_fallbackPicture;
protected override void OnParametersSet()
{
m_fallbackPicture ??= $"this.src='{Assets.Get(@"img/DefaultAuthor.png")}'";
}
}
Proposed Blazorise API
<Image Source="@ProfilePicture" FallbackSource="@Assets.Get(@"img/DefaultAuthor.png")" />
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: Feature ⚙Request or idea for a new feature.Request or idea for a new feature.
Type
Projects
Status
Done