From 1fec1bb2f61bbdac24ad448f578bccfa875b8fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A7=89?= Date: Tue, 24 Oct 2023 05:08:09 +0800 Subject: [PATCH] Add maxWidth and ellipsis to music list item name --- src/music.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/music.js b/src/music.js index 5cf9f6b..6677523 100644 --- a/src/music.js +++ b/src/music.js @@ -247,6 +247,7 @@ export default class MusicList { alignItems: 'center', justifyContent: 'space-between', gap: '.25rem', + maxWidth: '100%', }, children: [ ...(item.picture ? [Img({ @@ -254,6 +255,12 @@ export default class MusicList { style: { width: '2em', height: '2em', borderRadius: '.25em' } })] : []), Span({ + style: { + flex: 1, + textOverflow: 'ellipsis', + whiteSpace: 'nowrap', + overflowX: 'hidden', + }, title: `${item.name} - ${bytesToSize(item.size)} - ${item.type}`, textContent: `${item.name} - ${bytesToSize(item.size)}`, onclick: event => {