fix: http delete btn hide

This commit is contained in:
Joel
2024-04-01 19:58:41 +08:00
parent 04b4be27b7
commit 5c3162cc33
2 changed files with 8 additions and 17 deletions

View File

@@ -69,7 +69,7 @@ const KeyValueList: FC<Props> = ({
{ {
list.map((item, index) => ( list.map((item, index) => (
<KeyValueItem <KeyValueItem
key={index} key={item.key + index}
nodeId={nodeId} nodeId={nodeId}
payload={item} payload={item}
onChange={handleChange(index)} onChange={handleChange(index)}

View File

@@ -50,16 +50,6 @@ const InputItem: FC<Props> = ({
<div className={cn(className, 'hover:bg-gray-50 hover:cursor-text', 'relative flex h-full items-center')}> <div className={cn(className, 'hover:bg-gray-50 hover:cursor-text', 'relative flex h-full items-center')}>
{(!readOnly) {(!readOnly)
? ( ? (
// <input
// type='text'
// className='w-full h-[18px] leading-[18px] pl-0.5 text-gray-900 text-xs font-normal placeholder:text-gray-300 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-gray-200'
// value={value}
// onChange={handleChange}
// onBlur={setIsEditFalse}
// autoFocus
// placeholder={placeholder}
// readOnly={readOnly}
// />
<Input <Input
className={cn(isFocus ? 'bg-gray-100' : 'bg-width', 'w-0 grow px-3 py-1')} className={cn(isFocus ? 'bg-gray-100' : 'bg-width', 'w-0 grow px-3 py-1')}
value={value} value={value}
@@ -87,13 +77,14 @@ const InputItem: FC<Props> = ({
placeholderClassName='!leading-[21px]' placeholderClassName='!leading-[21px]'
/> />
)} )}
{hasRemove && !isFocus && (
<RemoveButton
className='group-hover:block hidden absolute right-1 top-0.5'
onClick={handleRemove}
/>
)}
</div>} </div>}
{hasRemove && !isFocus && (
<RemoveButton
className='group-hover:block hidden absolute right-1 top-0.5'
onClick={handleRemove}
/>
)}
</div> </div>
) )
} }