diff --git a/src/Connected.Components/Components/InputPassword.razor.cs b/src/Connected.Components/Components/InputPassword.razor.cs
index 8d0f3c2..ddb325f 100644
--- a/src/Connected.Components/Components/InputPassword.razor.cs
+++ b/src/Connected.Components/Components/InputPassword.razor.cs
@@ -1,4 +1,5 @@
-using Microsoft.AspNetCore.Components;
+using Connected.Models;
+using Microsoft.AspNetCore.Components;
namespace Connected.Components;
public partial class InputPassword: InputBase
diff --git a/src/Connected.Components/Components/InputText.razor b/src/Connected.Components/Components/InputText.razor
index efc8fd6..9cbc275 100644
--- a/src/Connected.Components/Components/InputText.razor
+++ b/src/Connected.Components/Components/InputText.razor
@@ -1,4 +1,6 @@
-@inherits InputBase;
+@using Connected.Models;
+
+@inherits InputBase;
@if (NumOfRows==1)
@@ -38,16 +40,18 @@
}
- @if (Clearable)
+ @if (Clearable && Value.ToString().Length>0)
{
-
+
+
}
@if (IsError)
{
-
+
+
}
diff --git a/src/Connected.Components/Components/InputText.razor.cs b/src/Connected.Components/Components/InputText.razor.cs
index 76bbc58..08ef495 100644
--- a/src/Connected.Components/Components/InputText.razor.cs
+++ b/src/Connected.Components/Components/InputText.razor.cs
@@ -1,4 +1,5 @@
-using Microsoft.AspNetCore.Components;
+using Connected.Models;
+using Microsoft.AspNetCore.Components;
namespace Connected.Components;
public partial class InputText: InputBase
@@ -6,7 +7,7 @@ public partial class InputText: InputBase
[Parameter]
public int NumOfRows
{
- get
+ get
{
return _numberOfLines;
}
@@ -34,16 +35,20 @@ public partial class InputText: InputBase
private async Task ChangeValueAsync(ChangeEventArgs args)
{
+ if (string.IsNullOrEmpty(args.Value.ToString())) ErrorText = string.Empty;
await ValueChanged.InvokeAsync(args.Value.ToString());
- StateHasChanged();
+ StateHasChanged();
}
private async Task Clear()
{
- await ValueChanged.InvokeAsync(string.Empty);
+ ChangeEventArgs arg = new ChangeEventArgs();
+ arg.Value = string.Empty;
+ await ChangeValueAsync(arg);
+
}
- protected override async Task OnInitializedAsync()
+ protected override async Task OnParametersSetAsync()
{
if (base.InputAttributes is null) base.InputAttributes = new();
if (base.Required)
diff --git a/src/Connected.Components/Connected.Components.csproj b/src/Connected.Components/Connected.Components.csproj
index 91d8e97..901a933 100644
--- a/src/Connected.Components/Connected.Components.csproj
+++ b/src/Connected.Components/Connected.Components.csproj
@@ -28,6 +28,8 @@
+
+