Skip to content

Commit

Permalink
fix: prevent subject grid tooltips scrolling page
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemmmy committed Oct 15, 2023
1 parent 8c1f7b9 commit 827f211
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/subjects/lists/grid/SubjectGridTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ interface Props {
tooltipContents?: ReactNode;
}

function stopWheel(e: React.WheelEvent<HTMLDivElement>) {
e.preventDefault();
return false;
}

export const SubjectGridTooltip = forwardRef<HTMLDivElement, Props>(function TooltipPortal({
showTooltip,
tooltipInnerRef,
Expand All @@ -24,6 +29,7 @@ export const SubjectGridTooltip = forwardRef<HTMLDivElement, Props>(function Too
<div
className="relative -left-[108px] -translate-y-full pb-lg pointer-events-auto"
ref={tooltipInnerRef}
onWheel={stopWheel}
>
<div className="relative rounded shadow-md bg-spotlight !w-[200px] p-xs">
{/* Tooltip arrow */}
Expand Down

0 comments on commit 827f211

Please sign in to comment.