[frontend/components] Set default value for prompt dialog

This commit is contained in:
pancakes 2025-01-28 13:01:15 +10:00 committed by Laura Hausmann
parent e6cf2f897d
commit b4f51ec561
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -40,7 +40,7 @@
await _module.InvokeVoidAsync("closeDialog", Dialog); await _module.InvokeVoidAsync("closeDialog", Dialog);
} }
public async Task Prompt(EventCallback<string?> action, string text, string placeholder, bool allowEmpty = false, bool multiLine = false, string? buttonText = null) public async Task Prompt(EventCallback<string?> action, string text, string placeholder, string? defaultValue, bool allowEmpty = false, bool multiLine = false, string? buttonText = null)
{ {
Action = action; Action = action;
Text = text; Text = text;
@ -48,7 +48,7 @@
Required = !allowEmpty; Required = !allowEmpty;
MultiLine = multiLine; MultiLine = multiLine;
ButtonText = buttonText; ButtonText = buttonText;
Input = ""; Input = defaultValue ?? "";
StateHasChanged(); StateHasChanged();