Skip to content

Commit

Permalink
Make the "TextArea" component be able to work independently
Browse files Browse the repository at this point in the history
  • Loading branch information
jsakamoto committed Feb 10, 2024
1 parent 788a9ce commit 66e96e1
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions BlazingStory/Internals/Components/Inputs/TextArea.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<label class="text-area-container">
<textarea class="bs-basic-inputs" placeholder="@this.PlaceHolder" @oninput="@((args) => this.OnInput.InvokeAsync(args))" value="@(this.Value ?? "")"></textarea>
<div class="bs-basic-inputs text-area-shadow">@((this.Value ?? "") + " ")</div>
<textarea class="bs-basic-inputs" placeholder="@this.PlaceHolder" @oninput="OnTextAreaInput" value="@(this.Value ?? "")"></textarea>
<div class="bs-basic-inputs text-area-shadow">@((this._Value ?? "") + " ")</div>
</label>

@code
Expand All @@ -13,4 +13,18 @@

[Parameter]
public EventCallback<ChangeEventArgs> OnInput { get; set; }

private string? _Value;

protected override void OnParametersSet()
{
base.OnParametersSet();
this._Value = this.Value;
}

private async Task OnTextAreaInput(ChangeEventArgs args)
{
this._Value = args.Value?.ToString();
await this.OnInput.InvokeAsync(args);
}
}

0 comments on commit 66e96e1

Please sign in to comment.