diff --git a/src/lib/components/channel/Messages/Message.svelte b/src/lib/components/channel/Messages/Message.svelte index 0050e42213..1b7062c105 100644 --- a/src/lib/components/channel/Messages/Message.svelte +++ b/src/lib/components/channel/Messages/Message.svelte @@ -71,13 +71,13 @@ let showButtons = false; - // Preserve the CSS anchor while letting actions escape the message scroll container. - const portalActions = (node: HTMLElement, keepOpen: boolean) => { + // The top layer escapes scroll clipping without moving actions out of the message's tab order. + const positionActions = (node: HTMLElement, keepOpen: boolean) => { const anchor = node.parentElement!; const messageElement = anchor.parentElement!; let cleanup: (() => void) | undefined; let destroyed = false; - document.body.appendChild(node); + node.showPopover(); const update = () => { if (destroyed) return; @@ -116,7 +116,6 @@ for (const element of [messageElement, node]) { for (const event of events) element.removeEventListener(event, scheduleUpdate); } - node.remove(); } }; }; @@ -272,9 +271,10 @@ {#if !edit && !disabled && !$$slots.header}