a fork of iceshrimp.net but a tweaked frontend to my personal liking. waow
fediverse social-media social iceshrimp fedi
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[frontend/components] Update Compose textarea state after updating value

pancakes ba1b7e96 49c8f733

+10 -5
+6 -2
Iceshrimp.Frontend/Components/Compose.razor
··· 524 524 PollChoices.Remove(choice); 525 525 } 526 526 527 - private ValueTask InsertTextAsync(string? text) => 528 - _module.InvokeVoidAsync("insertText", Textarea, text); 527 + private async Task InsertTextAsync(string? text) 528 + { 529 + if (text == null) return; 530 + NoteDraft.Text = await _module.InvokeAsync<string>("insertText", Textarea, text); 531 + StateHasChanged(); 532 + } 529 533 530 534 [JSInvokable] 531 535 public async Task PasteQuote(string pastedText)
+4 -3
Iceshrimp.Frontend/Components/Compose.razor.js
··· 43 43 44 44 /** 45 45 * @param {HTMLTextAreaElement} textarea 46 - * @param {string | null} text 46 + * @param {string} text 47 + * @returns {string} The updated textarea contents 47 48 */ 48 49 export function insertText(textarea, text) { 49 - if (text === null) return; 50 - 51 50 // Get the cursor position before inserting 52 51 const pos = textarea.selectionStart; 53 52 ··· 56 55 57 56 // Move cursor to correct position 58 57 textarea.setSelectionRange(pos + text.length, pos + text.length, "none"); 58 + 59 + return textarea.value; 59 60 }