about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Shared/SimpleComponents/FancyTextBox.razor
diff options
context:
space:
mode:
authorEmma@Rory& <root@rory.gay>2023-09-15 09:55:36 +0200
committerEmma@Rory& <root@rory.gay>2023-09-15 09:55:36 +0200
commite10fa389ce3c4d42deadfec8bf08c2fbb1a88d79 (patch)
tree1e2f8d8de07c6037ac4aa20be3b54ac43c2d7f2e /MatrixRoomUtils.Web/Shared/SimpleComponents/FancyTextBox.razor
parentCode cleanup (diff)
downloadMatrixUtils-e10fa389ce3c4d42deadfec8bf08c2fbb1a88d79.tar.xz
Refactors
Diffstat (limited to '')
-rw-r--r--MatrixRoomUtils.Web/Shared/SimpleComponents/FancyTextBox.razor29
-rw-r--r--MatrixRoomUtils.Web/Shared/SimpleComponents/FancyTextBox.razor.css5
2 files changed, 0 insertions, 34 deletions
diff --git a/MatrixRoomUtils.Web/Shared/SimpleComponents/FancyTextBox.razor b/MatrixRoomUtils.Web/Shared/SimpleComponents/FancyTextBox.razor
deleted file mode 100644

index 966c44d..0000000 --- a/MatrixRoomUtils.Web/Shared/SimpleComponents/FancyTextBox.razor +++ /dev/null
@@ -1,29 +0,0 @@ -@inject IJSRuntime JsRuntime -@if (isVisible) { - <input autofocus type="@(IsPassword ? "password" : "text")" @bind="Value" @onfocusout="() => { isVisible = false; ValueChanged.InvokeAsync(Value); }" @ref="elementToFocus"/> -} -else { - <span class="fancy-textbox-inline" tabindex="0" style="@(string.IsNullOrEmpty(Value) ? "min-width: 50px;" : "")" @onfocusin="() => isVisible = true">@(Formatter?.Invoke(Value) ?? (IsPassword ? string.Join("", Value.Select(x => '*')) : Value))</span> -} - -@code { - - [Parameter] - public string Value { get; set; } - - [Parameter] - public bool IsPassword { get; set; } = false; - - [Parameter] - public EventCallback<string> ValueChanged { get; set; } - - [Parameter] - public Func<string?, string>? Formatter { get; set; } - - private bool isVisible { get; set; } = false; - - private ElementReference elementToFocus; - - protected override async Task OnAfterRenderAsync(bool firstRender) => await JsRuntime.InvokeVoidAsync("BlazorFocusElement", elementToFocus); - -} \ No newline at end of file diff --git a/MatrixRoomUtils.Web/Shared/SimpleComponents/FancyTextBox.razor.css b/MatrixRoomUtils.Web/Shared/SimpleComponents/FancyTextBox.razor.css deleted file mode 100644
index 01b2c6f..0000000 --- a/MatrixRoomUtils.Web/Shared/SimpleComponents/FancyTextBox.razor.css +++ /dev/null
@@ -1,5 +0,0 @@ -.fancy-textbox-inline { - border-bottom: #ccc solid 1px; - height: 1.4em; - display: inline-block; -} \ No newline at end of file