diff --git a/ShoppingAssistantWebClient.Web/Pages/Chat.razor b/ShoppingAssistantWebClient.Web/Pages/Chat.razor index dbc9d45..1c24cfe 100644 --- a/ShoppingAssistantWebClient.Web/Pages/Chat.razor +++ b/ShoppingAssistantWebClient.Web/Pages/Chat.razor @@ -76,7 +76,6 @@ } - } @@ -88,7 +87,6 @@ placeholder="Describe what you are looking for...."> Send message - diff --git a/ShoppingAssistantWebClient.Web/Pages/Chat.razor.cs b/ShoppingAssistantWebClient.Web/Pages/Chat.razor.cs index 865eb1d..656b2c9 100644 --- a/ShoppingAssistantWebClient.Web/Pages/Chat.razor.cs +++ b/ShoppingAssistantWebClient.Web/Pages/Chat.razor.cs @@ -7,8 +7,11 @@ using ShoppingAssistantWebClient.Web.Models.Input; using ShoppingAssistantWebClient.Web.Models.Enums; using System.Text.RegularExpressions; using ShoppingAssistantWebClient.Web.Services; +using Microsoft.JSInterop; + namespace ShoppingAssistantWebClient.Web.Pages; + public partial class Chat : ComponentBase { diff --git a/ShoppingAssistantWebClient.Web/Pages/Index.razor b/ShoppingAssistantWebClient.Web/Pages/Index.razor index 1fe2e9a..1d81c33 100644 --- a/ShoppingAssistantWebClient.Web/Pages/Index.razor +++ b/ShoppingAssistantWebClient.Web/Pages/Index.razor @@ -50,8 +50,8 @@
- + Send message
@@ -115,4 +115,20 @@ } + private void InputChanged(ChangeEventArgs e) + { + // Оновіть значення поля введення при кожному введенні тексту + inputValue = e.Value.ToString(); + } + public void Enter(KeyboardEventArgs e) + { + if (e.Code == "Enter" || e.Code == "NumpadEnter") + { + + if (!string.IsNullOrWhiteSpace(inputValue)) + { + CreateNewChat(); + } + } + } }