Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
fix(breadcrumb): Breadcrumb navigation super long problem, hidden ove…
Browse files Browse the repository at this point in the history
…rflow content

#311
  • Loading branch information
wuxinheng committed Oct 28, 2023
1 parent dbfe041 commit 8960ba4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/TDesign/Components/Breadcrumb/TBreadcrumbItem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.Extensions.Options;
using System.Security.Cryptography.X509Certificates;

namespace TDesign;

Expand Down Expand Up @@ -43,16 +44,16 @@ protected override void BuildCssClass(ICssClassBuilder builder)

protected override void AddContent(RenderTreeBuilder builder, int sequence)
{
builder.CreateElement(sequence, !string.IsNullOrEmpty(Link) ? "a" : "span", overflow =>
builder.CreateElement(sequence, !string.IsNullOrEmpty(Link) ? "a" : "p", overflow =>
{
overflow.CreateElement(0, "span", ChildContent, new { @class = "t-breadcrumb__inner", style = "max-width:120px" });
overflow.CreateElement(0, "p", ChildContent, new { style = "max-width:150px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;", });
}, new
{
@class = HtmlHelper.Instance.Class().Append("t-breadcrumb--text-overflow")
.Append("t-link", HasLink).Append("t-is-disabled", Disabled)
});

builder.CreateElement(sequence + 1, "span", SeperatorContent, new { @class = "t-breadcrumb__separator" });
builder.CreateElement(sequence + 1, "p", SeperatorContent, new { @class = "t-breadcrumb__separator" });
}
protected override void OnParametersSet()
{
Expand All @@ -64,4 +65,9 @@ protected override void OnParametersSet()
}
}

protected override Task OnParametersSetAsync()
{
return base.OnParametersSetAsync();
}

}

0 comments on commit 8960ba4

Please sign in to comment.