fix: hover controls position (#7093)

This commit is contained in:
Kilu.He 2024-12-30 15:51:58 +08:00 committed by GitHub
parent 256d015967
commit 5e581e912f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,7 @@ import { getScrollParent } from '@/components/global-comment/utils';
import React, { useCallback, useEffect, useRef } from 'react';
import { ReactEditor, useReadOnly, useSlateStatic } from 'slate-react';
function TableContainer({ blockId, readSummary, children, paddingLeft = 0 }: {
function TableContainer ({ blockId, readSummary, children, paddingLeft = 0 }: {
blockId: string;
readSummary?: boolean;
children?: React.ReactNode;
@ -99,12 +99,12 @@ function TableContainer({ blockId, readSummary, children, paddingLeft = 0 }: {
<div
ref={controlRef}
style={{
left: (left - 64) + 'px',
left: (offsetLeftRef.current - 64) + 'px',
visibility: showControl ? 'visible' : 'hidden',
zIndex: showControl ? 10 : -1,
pointerEvents: showControl ? 'auto' : 'none',
}}
contentEditable={false}
className={'absolute z-[10] w-[64px] top-2 block pr-1'}
>