From 45cf77c1a78951d680bbf8f5bd370d01ff0814ea Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 15 Feb 2025 15:33:02 +0100 Subject: [PATCH] Fixed an issue when typing the next prompt & data source options where open --- app/MindWork AI Studio/Components/ChatComponent.razor.cs | 3 +++ .../Components/DataSourceSelection.razor.cs | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/app/MindWork AI Studio/Components/ChatComponent.razor.cs b/app/MindWork AI Studio/Components/ChatComponent.razor.cs index fc3d2fe7..10b8bd79 100644 --- a/app/MindWork AI Studio/Components/ChatComponent.razor.cs +++ b/app/MindWork AI Studio/Components/ChatComponent.razor.cs @@ -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(); diff --git a/app/MindWork AI Studio/Components/DataSourceSelection.razor.cs b/app/MindWork AI Studio/Components/DataSourceSelection.razor.cs index 031de0d1..a2eeca8b 100644 --- a/app/MindWork AI Studio/Components/DataSourceSelection.razor.cs +++ b/app/MindWork AI Studio/Components/DataSourceSelection.razor.cs @@ -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)