diff --git a/plugins/attachment-resources/src/components/AccordionEditor.svelte b/plugins/attachment-resources/src/components/AccordionEditor.svelte index d91ffdce61..2a09e98240 100644 --- a/plugins/attachment-resources/src/components/AccordionEditor.svelte +++ b/plugins/attachment-resources/src/components/AccordionEditor.svelte @@ -35,6 +35,8 @@ const attachments: AttachmentStyledBox[] = [] const edits: TextEditor[] = [] let hasAttachments: boolean = false + const expanded: boolean[] = [] + items.forEach(() => expanded.push(false)) const flip = (index: number, ev?: MouseEvent): void => { ev?.stopPropagation() @@ -54,6 +56,14 @@ break } } + + const onScroll = (row: number, ev: Event) => { + const target = ev.target as HTMLDivElement + if (target && !expanded[row] && target.clientHeight < target.scrollHeight) { + expanded[row] = true + flip(row) + } + }
@@ -71,7 +81,7 @@ }} > -
+
onScroll(i, ev)}> {#if item.state === 'closed'}