Link will now be white and underline + Click on the game to lose focus of input field (#1315)
* Link will now be white and underline Click on the game to lose focus of input field * Use bind:this instead of querySelector Add isClickedInside and isClickedOutside to HtmlUtils to know if the user click inside/outside an element targeted
This commit is contained in:
parent
fc9865e273
commit
95af568653
4 changed files with 32 additions and 7 deletions
|
@ -1,6 +1,12 @@
|
|||
<script lang="ts">
|
||||
import {chatMessagesStore, chatInputFocusStore} from "../../Stores/ChatStore";
|
||||
|
||||
export const handleForm = {
|
||||
blur() {
|
||||
inputElement.blur();
|
||||
}
|
||||
}
|
||||
let inputElement: HTMLElement;
|
||||
let newMessageText = '';
|
||||
|
||||
function onFocus() {
|
||||
|
@ -18,7 +24,7 @@
|
|||
</script>
|
||||
|
||||
<form on:submit|preventDefault={saveMessage}>
|
||||
<input type="text" bind:value={newMessageText} placeholder="Enter your message..." on:focus={onFocus} on:blur={onBlur} >
|
||||
<input type="text" bind:value={newMessageText} placeholder="Enter your message..." on:focus={onFocus} on:blur={onBlur} bind:this={inputElement}>
|
||||
<button type="submit">
|
||||
<img src="/static/images/send.png" alt="Send" width="20">
|
||||
</button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue