fix: Make the damn textbox stop unfocusing on message submit

This commit is contained in:
April Hall 2025-02-24 03:15:29 -05:00
parent e34fa995d3
commit a7f0df468d
Signed by: arithefirst
GPG Key ID: 4508A15C4DB91C5B
2 changed files with 3 additions and 2 deletions

View File

@ -12,7 +12,7 @@ A more complex version of this list is available [here](https://trello.com/b/kJw
- [ ] Installation documentation - [ ] Installation documentation
- [ ] LaTeX support - [ ] LaTeX support
- [ ] Notifications - [ ] Notifications
- [ ] Make the damn textbox stop unfocusing on every message submit - [x] Make the damn textbox stop unfocusing on every message submit
- [ ] Message context menus - [ ] Message context menus
- [ ] Message Timestamps - [ ] Message Timestamps
- [x] Markdown Support - [x] Markdown Support

View File

@ -21,7 +21,8 @@
let textareaRef: HTMLTextAreaElement | undefined = $state(); let textareaRef: HTMLTextAreaElement | undefined = $state();
let formref: HTMLFormElement | undefined = $state(); let formref: HTMLFormElement | undefined = $state();
function submit() { function submit(event: Event) {
event.preventDefault();
if (msg.length <= 2000) { if (msg.length <= 2000) {
socket?.sendMessage(data.currentUser, msg); socket?.sendMessage(data.currentUser, msg);
if (textareaRef) textareaRef.style.height = '40px'; if (textareaRef) textareaRef.style.height = '40px';