fix: render hint popover via FloatingPortal to prevent overflow clipping
The popover was invisible because it rendered inside the table's overflow-x:auto scroll container. FloatingPortal moves it to document.body. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useState } from 'react';
|
||||
import { useFloating, useClick, useDismiss, useInteractions, offset, shift, size } from '@floating-ui/react';
|
||||
import { useFloating, useClick, useDismiss, useInteractions, offset, shift, size, FloatingPortal } from '@floating-ui/react';
|
||||
|
||||
const HINT_ICONS = {
|
||||
film: 'fa-solid fa-film',
|
||||
@@ -46,14 +46,16 @@ export default function ActorPopover({ hintType, hintText }) {
|
||||
<i className={iconClass}></i>
|
||||
</button>
|
||||
{isOpen && (
|
||||
<div
|
||||
ref={refs.setFloating}
|
||||
style={floatingStyles}
|
||||
{...getFloatingProps()}
|
||||
className="actor-popover"
|
||||
>
|
||||
{hintText}
|
||||
</div>
|
||||
<FloatingPortal>
|
||||
<div
|
||||
ref={refs.setFloating}
|
||||
style={floatingStyles}
|
||||
{...getFloatingProps()}
|
||||
className="actor-popover"
|
||||
>
|
||||
{hintText}
|
||||
</div>
|
||||
</FloatingPortal>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user