fix: 🚸 autosize post form textarea

This commit is contained in:
ThatOneCalculator 2023-07-28 11:41:25 -07:00
parent ee591012c1
commit 4a0fc56ba8
No known key found for this signature in database
GPG key ID: 8703CACD01000000

View file

@ -236,6 +236,7 @@
import { inject, watch, nextTick, onMounted, defineAsyncComponent } from "vue"; import { inject, watch, nextTick, onMounted, defineAsyncComponent } from "vue";
import * as mfm from "mfm-js"; import * as mfm from "mfm-js";
import * as misskey from "firefish-js"; import * as misskey from "firefish-js";
import autosize from "autosize";
import insertTextAtCursor from "insert-text-at-cursor"; import insertTextAtCursor from "insert-text-at-cursor";
import { length } from "stringz"; import { length } from "stringz";
import { toASCII } from "punycode/"; import { toASCII } from "punycode/";
@ -973,6 +974,7 @@ onMounted(() => {
nextTick(() => { nextTick(() => {
focus(); focus();
}); });
} }
// TODO: detach when unmount // TODO: detach when unmount
@ -980,7 +982,10 @@ onMounted(() => {
new Autocomplete(cwInputEl, $$(cw)); new Autocomplete(cwInputEl, $$(cw));
new Autocomplete(hashtagsInputEl, $$(hashtags)); new Autocomplete(hashtagsInputEl, $$(hashtags));
autosize(textareaEl);
nextTick(() => { nextTick(() => {
autosize(textareaEl);
// 稿 // 稿
if (!props.instant && !props.mention && !props.specified) { if (!props.instant && !props.mention && !props.specified) {
const draft = JSON.parse(localStorage.getItem("drafts") || "{}")[ const draft = JSON.parse(localStorage.getItem("drafts") || "{}")[