refactor: Modify the triggering method of the variable selector in the modification object subtree panel.

- Change the "onClick" event to "onMouseDown" event to address any potential issues related to mouse events, such as when using Http json editor to select structured data, the position offset after clicking causes the inability to select.
pull/22238/head
yijiaquan 11 months ago
parent 2a85f28963
commit 2e81a7840f

@ -41,7 +41,7 @@ const Field: FC<Props> = ({
<Tooltip popupContent={t('app.structOutput.moreFillTip')} disabled={depth !== MAX_DEPTH + 1}> <Tooltip popupContent={t('app.structOutput.moreFillTip')} disabled={depth !== MAX_DEPTH + 1}>
<div <div
className={cn('flex items-center justify-between rounded-md pr-2', !readonly && 'hover:bg-state-base-hover', depth !== MAX_DEPTH + 1 && 'cursor-pointer')} className={cn('flex items-center justify-between rounded-md pr-2', !readonly && 'hover:bg-state-base-hover', depth !== MAX_DEPTH + 1 && 'cursor-pointer')}
onClick={() => !readonly && onSelect?.([...valueSelector, name])} onMouseDown={() => !readonly && onSelect?.([...valueSelector, name])}
> >
<div className='flex grow items-stretch'> <div className='flex grow items-stretch'>
<TreeIndentLine depth={depth} /> <TreeIndentLine depth={depth} />

Loading…
Cancel
Save