chore: fix schema editor can not hover item (#22155)

This commit is contained in:
Joel
2025-07-10 17:33:11 +08:00
committed by GitHub
parent 0e793a660d
commit 11f9a897e8

View File

@@ -79,13 +79,13 @@ const SchemaNode: FC<SchemaNodeProps> = ({
} }
const handleMouseEnter = () => { const handleMouseEnter = () => {
if(!readOnly) return if(readOnly) return
if (advancedEditing || isAddingNewField) return if (advancedEditing || isAddingNewField) return
setHoveringPropertyDebounced(path.join('.')) setHoveringPropertyDebounced(path.join('.'))
} }
const handleMouseLeave = () => { const handleMouseLeave = () => {
if(!readOnly) return if(readOnly) return
if (advancedEditing || isAddingNewField) return if (advancedEditing || isAddingNewField) return
setHoveringPropertyDebounced(null) setHoveringPropertyDebounced(null)
} }
@@ -95,7 +95,7 @@ const SchemaNode: FC<SchemaNodeProps> = ({
<div className={classNames('relative z-10', indentPadding[depth])}> <div className={classNames('relative z-10', indentPadding[depth])}>
{depth > 0 && hasChildren && ( {depth > 0 && hasChildren && (
<div className={classNames( <div className={classNames(
'flex items-center absolute top-0 w-5 h-7 px-0.5 z-10 bg-background-section-burn', 'absolute top-0 z-10 flex h-7 w-5 items-center bg-background-section-burn px-0.5',
indentLeft[depth - 1], indentLeft[depth - 1],
)}> )}>
<button <button
@@ -140,8 +140,8 @@ const SchemaNode: FC<SchemaNodeProps> = ({
</div> </div>
<div className={classNames( <div className={classNames(
'flex justify-center w-5 absolute z-0', 'absolute z-0 flex w-5 justify-center',
schema.description ? 'h-[calc(100%-3rem)] top-12' : 'h-[calc(100%-1.75rem)] top-7', schema.description ? 'top-12 h-[calc(100%-3rem)]' : 'top-7 h-[calc(100%-1.75rem)]',
indentLeft[depth], indentLeft[depth],
)}> )}>
<Divider <Divider