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 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 = {
|
const HINT_ICONS = {
|
||||||
film: 'fa-solid fa-film',
|
film: 'fa-solid fa-film',
|
||||||
@@ -46,14 +46,16 @@ export default function ActorPopover({ hintType, hintText }) {
|
|||||||
<i className={iconClass}></i>
|
<i className={iconClass}></i>
|
||||||
</button>
|
</button>
|
||||||
{isOpen && (
|
{isOpen && (
|
||||||
<div
|
<FloatingPortal>
|
||||||
ref={refs.setFloating}
|
<div
|
||||||
style={floatingStyles}
|
ref={refs.setFloating}
|
||||||
{...getFloatingProps()}
|
style={floatingStyles}
|
||||||
className="actor-popover"
|
{...getFloatingProps()}
|
||||||
>
|
className="actor-popover"
|
||||||
{hintText}
|
>
|
||||||
</div>
|
{hintText}
|
||||||
|
</div>
|
||||||
|
</FloatingPortal>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user