mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-02-05 20:29:07 +00:00
Fixed spellchecking config for single line dialog (#49)
This commit is contained in:
parent
d6bd0dc45b
commit
0f06b96943
@ -1,7 +1,7 @@
|
|||||||
<MudDialog>
|
<MudDialog>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<MudText Typo="Typo.body1">@this.Message</MudText>
|
<MudText Typo="Typo.body1">@this.Message</MudText>
|
||||||
<MudTextField T="string" @bind-Text="@this.UserInput" Variant="Variant.Outlined" AutoGrow="@false" Lines="1" Label="Chat name" AutoFocus="@true"/>
|
<MudTextField T="string" @bind-Text="@this.UserInput" Variant="Variant.Outlined" AutoGrow="@false" Lines="1" Label="Chat name" AutoFocus="@true" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<MudButton OnClick="@this.Cancel" Variant="Variant.Filled">Cancel</MudButton>
|
<MudButton OnClick="@this.Cancel" Variant="Variant.Filled">Cancel</MudButton>
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
using AIStudio.Settings;
|
||||||
|
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
namespace AIStudio.Components.CommonDialogs;
|
namespace AIStudio.Components.CommonDialogs;
|
||||||
@ -19,6 +21,22 @@ public partial class SingleInputDialog : ComponentBase
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public Color ConfirmColor { get; set; } = Color.Error;
|
public Color ConfirmColor { get; set; } = Color.Error;
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
private SettingsManager SettingsManager { get; set; } = null!;
|
||||||
|
|
||||||
|
private static readonly Dictionary<string, object?> USER_INPUT_ATTRIBUTES = new();
|
||||||
|
|
||||||
|
#region Overrides of ComponentBase
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
// Configure the spellchecking for the user input:
|
||||||
|
this.SettingsManager.InjectSpellchecking(USER_INPUT_ATTRIBUTES);
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
private void Cancel() => this.MudDialog.Cancel();
|
private void Cancel() => this.MudDialog.Cancel();
|
||||||
|
|
||||||
private void Confirm() => this.MudDialog.Close(DialogResult.Ok(this.UserInput));
|
private void Confirm() => this.MudDialog.Close(DialogResult.Ok(this.UserInput));
|
||||||
|
Loading…
Reference in New Issue
Block a user