fix: human input field dragging

This commit is contained in:
JzoNg 2026-01-26 11:46:52 +08:00
parent 9341227cf1
commit 2ccef3ac84
4 changed files with 8 additions and 5 deletions

View File

@ -61,7 +61,7 @@ export default function DraggableBlockPlugin({
menuComponent={ menuComponent={
isSupportDrag isSupportDrag
? ( ? (
<div ref={menuRef} className={cn(DRAGGABLE_BLOCK_MENU_CLASSNAME, 'absolute right-6 top-4 cursor-grab opacity-0 will-change-transform active:cursor-move')}> <div ref={menuRef} className={cn(DRAGGABLE_BLOCK_MENU_CLASSNAME, 'absolute right-2.5 top-4 cursor-grab opacity-0 will-change-transform active:cursor-move')}>
<RiDraggable className="size-3.5 text-text-tertiary" /> <RiDraggable className="size-3.5 text-text-tertiary" />
</div> </div>
) )

View File

@ -111,7 +111,7 @@ const HITLInputComponentUI: FC<HITLInputComponentUIProps> = ({
</div> </div>
</div> </div>
<div className="flex w-full items-center gap-x-0.5 pr-8"> <div className="flex w-full items-center gap-x-0.5 pr-5">
<div className="min-w-0 grow"> <div className="min-w-0 grow">
{/* Default Value Info */} {/* Default Value Info */}
{isDefaultValueVariable && ( {isDefaultValueVariable && (

View File

@ -13,6 +13,7 @@ import {
memo, memo,
useEffect, useEffect,
} from 'react' } from 'react'
import { CustomTextNode } from '../custom-text/node'
import { import {
$createHITLInputNode, $createHITLInputNode,
HITLInputNode, HITLInputNode,
@ -70,9 +71,11 @@ const HITLInputBlock = memo(({
undefined, undefined,
readonly, readonly,
) )
const prev = new CustomTextNode('\n')
$insertNodes([prev])
$insertNodes([currentHITLNode]) $insertNodes([currentHITLNode])
const next = new CustomTextNode('\n')
$insertNodes([next])
if (onInsert) if (onInsert)
onInsert() onInsert()

View File

@ -164,7 +164,7 @@ export class HITLInputNode extends DecoratorNode<React.JSX.Element> {
createDOM(): HTMLElement { createDOM(): HTMLElement {
const div = document.createElement('div') const div = document.createElement('div')
div.classList.add('flex', 'items-center', 'align-middle', 'support-drag') div.classList.add('inline-flex', 'w-[calc(100%-1px)]', 'items-center', 'align-middle', 'support-drag')
return div return div
} }