ui: 修正 文件卡片 文字折行失敗

* https://commandnotfound.cn/css-layout/101/644/CSS-控制长文本自动折行
* 也許是 width 相關導致word-wrap 沒效果?
* 玄學
This commit is contained in:
CrescentLeaf
2025-10-03 01:08:57 +08:00
parent 14c279cc80
commit 82c5aeaaa0

View File

@@ -5,12 +5,11 @@ customElements.define('chat-file', class extends HTMLElement {
super()
}
connectedCallback() {
this.style.display = 'block'
const e = new DOMParser().parseFromString(`
<a style="width: 100%;height: 100%;">
<mdui-card variant="outlined" clickable style="display: flex;align-items: center;">
<mdui-icon name="insert_drive_file" style="margin: 13px;font-size: 34px;"></mdui-icon>
<span style="margin-right: 13px;"></span>
<span style="margin-right: 13px; word-wrap: break-word; word-break:break-all;white-space:normal; max-width :100%;"></span>
</mdui-card>
</a>`, 'text/html').body.firstChild as HTMLElement
$(e).find('span').text($(this).attr("name"))