diff --git a/front/src/Components/Chat/Chat.svelte b/front/src/Components/Chat/Chat.svelte index e39d1a59..a636205b 100644 --- a/front/src/Components/Chat/Chat.svelte +++ b/front/src/Components/Chat/Chat.svelte @@ -3,9 +3,12 @@ import { chatMessagesStore, chatVisibilityStore } from "../../Stores/ChatStore"; import ChatMessageForm from './ChatMessageForm.svelte'; import ChatElement from './ChatElement.svelte'; - import { afterUpdate, beforeUpdate } from "svelte"; + import {afterUpdate, beforeUpdate} from "svelte"; + import {HtmlUtils} from "../../WebRtc/HtmlUtils"; let listDom: HTMLElement; + let chatWindowElement: HTMLElement; + let handleFormBlur: { blur():void }; let autoscroll: boolean; beforeUpdate(() => { @@ -16,6 +19,12 @@ if (autoscroll) listDom.scrollTo(0, listDom.scrollHeight); }); + function onClick(event: MouseEvent) { + if (HtmlUtils.isClickedOutside(event, chatWindowElement)) { + handleFormBlur.blur(); + } + } + function closeChat() { chatVisibilityStore.set(false); } @@ -26,10 +35,10 @@ } - + -