Skip to content

Commit a736ea9

Browse files
authored
Fix label HTML render output (#143)
* Fix label HTML render output * Remove unnecessary ToString() from Text property
1 parent b806c95 commit a736ea9

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace BlazorWebFormsComponents.Interfaces
2+
{
3+
public interface ITextComponent
4+
{
5+
string Text { get; set; }
6+
}
7+
}

src/BlazorWebFormsComponents/Label.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
@if (Visible)
44
{
5-
<label id="@ID">@Text.ToString()</label>
5+
<span id="@ID">@Text</span>
66
}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
using Microsoft.AspNetCore.Components;
1+
using BlazorWebFormsComponents.Interfaces;
2+
using Microsoft.AspNetCore.Components;
23

34
namespace BlazorWebFormsComponents
45
{
5-
public partial class Label : BaseWebFormsComponent
6+
public partial class Label : BaseWebFormsComponent, ITextComponent
67
{
7-
[Parameter] public object Text { get; set; }
8-
8+
[Parameter]
9+
public string Text { get; set; }
910
}
1011
}

0 commit comments

Comments
 (0)