Fixed an issue when typing the next prompt & data source options where open

This commit is contained in:
Thorsten Sommer 2025-02-15 15:33:02 +01:00
parent c6ab1b1b7d
commit 45cf77c1a7
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 11 additions and 0 deletions

View File

@ -331,6 +331,9 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
private async Task InputKeyEvent(KeyboardEventArgs keyEvent)
{
if(this.dataSourceSelectionComponent?.IsVisible ?? false)
this.dataSourceSelectionComponent.Hide();
this.hasUnsavedChanges = true;
var key = keyEvent.Code.ToLowerInvariant();

View File

@ -147,6 +147,14 @@ public partial class DataSourceSelection : ComponentBase, IMessageBusReceiver, I
//
}
public bool IsVisible => this.showDataSourceSelection;
public void Hide()
{
this.showDataSourceSelection = false;
this.StateHasChanged();
}
private async Task LoadAndApplyFilters()
{
if(this.DataSourceOptions.DisableDataSources)