fix(ui): portal timeline preview tooltip
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { For, Show, createEffect, createMemo, createSignal, onCleanup, on, untrack, type Component, type Accessor } from "solid-js"
|
import { For, Show, createEffect, createMemo, createSignal, onCleanup, on, untrack, type Component, type Accessor } from "solid-js"
|
||||||
|
import { Portal } from "solid-js/web"
|
||||||
import MessagePreview from "./message-preview"
|
import MessagePreview from "./message-preview"
|
||||||
import { messageStoreBus } from "../stores/message-v2/bus"
|
import { messageStoreBus } from "../stores/message-v2/bus"
|
||||||
import type { ClientPart } from "../types/message"
|
import type { ClientPart } from "../types/message"
|
||||||
@@ -838,6 +839,7 @@ const MessageTimeline: Component<MessageTimelineProps> = (props) => {
|
|||||||
{(data) => {
|
{(data) => {
|
||||||
onCleanup(() => setTooltipElement(null))
|
onCleanup(() => setTooltipElement(null))
|
||||||
return (
|
return (
|
||||||
|
<Portal>
|
||||||
<div
|
<div
|
||||||
ref={(element) => setTooltipElement(element)}
|
ref={(element) => setTooltipElement(element)}
|
||||||
class="message-timeline-tooltip"
|
class="message-timeline-tooltip"
|
||||||
@@ -856,6 +858,7 @@ const MessageTimeline: Component<MessageTimelineProps> = (props) => {
|
|||||||
selectedMessageIds={props.selectedMessageIds}
|
selectedMessageIds={props.selectedMessageIds}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</Portal>
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
</Show>
|
</Show>
|
||||||
|
|||||||
Reference in New Issue
Block a user