diff --git a/client/init.ts b/client/init.ts index ec44a64..8286f5a 100644 --- a/client/init.ts +++ b/client/init.ts @@ -14,7 +14,7 @@ import './ui/chat-elements/chat-text.ts' import './ui/chat-elements/chat-mention.ts' import './ui/chat-elements/chat-text-container.ts' import './ui/chat-elements/chat-quote.ts' -import './ui/InputElement.ts' +import './ui/MduiPatchedTextAreaElement.ts' import './ui/InnerTextContainerElement.ts' import Main from "./ui/Main.tsx" diff --git a/client/ui/InputElement.ts b/client/ui/MduiPatchedTextAreaElement.ts similarity index 92% rename from client/ui/InputElement.ts rename to client/ui/MduiPatchedTextAreaElement.ts index 63ef0c1..7cf2855 100644 --- a/client/ui/InputElement.ts +++ b/client/ui/MduiPatchedTextAreaElement.ts @@ -1,6 +1,6 @@ import { $ } from "mdui" -export default class InputElement extends HTMLElement { +export default class MduiPatchedTextAreaElement extends HTMLElement { static observedAttributes = ['user-id'] declare inputDiv: HTMLDivElement constructor() { @@ -55,4 +55,4 @@ export default class InputElement extends HTMLElement { } } -customElements.define('input-element', InputElement) +customElements.define('mdui-patched-textarea', MduiPatchedTextAreaElement) diff --git a/client/ui/chat-fragment/ChatFragment.tsx b/client/ui/chat-fragment/ChatFragment.tsx index 0085283..db5db23 100644 --- a/client/ui/chat-fragment/ChatFragment.tsx +++ b/client/ui/chat-fragment/ChatFragment.tsx @@ -160,7 +160,7 @@ export default function ChatFragment({ }} onDrop={(e) => { // 文件拽入 }}> - { + { if (inputRef.current?.value.trim() == '') { // 清空缓存的文件 } @@ -182,10 +182,6 @@ export default function ChatFragment({ marginTop: '3px', marginBottom: '3px', }}> - { - // @ts-ignore - - } `; } + renderPatchedTextArea(hasInputSlot) { + return html ``; + } /** * @param hasError 是否包含错误提示 * @param hasHelper 是否含 helper 属性或 helper slot