WIP: MduiCustomTextArea

This commit is contained in:
CrescentLeaf
2026-01-04 17:39:22 +08:00
parent d4557ca0ae
commit 3bada7c431
4 changed files with 9 additions and 8 deletions

View File

@@ -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)

View File

@@ -160,7 +160,7 @@ export default function ChatFragment({
}} onDrop={(e) => {
// 文件拽入
}}>
<mdui-text-field variant="outlined" placeholder="(。・ω・。)" autosize ref={inputRef} /* max-rows={6} */ onChange={() => {
<mdui-text-field variant="outlined" use-patched-textarea placeholder="(。・ω・。)" autosize ref={inputRef} /* max-rows={6} */ onChange={() => {
if (inputRef.current?.value.trim() == '') {
// 清空缓存的文件
}
@@ -182,10 +182,6 @@ export default function ChatFragment({
marginTop: '3px',
marginBottom: '3px',
}}>
{
// @ts-ignore
<input-element slot="input" />
}
</mdui-text-field>
<mdui-button-icon slot="end-icon" icon="attach_file" style={{
marginRight: '6px',