refactor: Update InputListComponent to fix button behavior
Fix the button behavior in the InputListComponent to correctly handle the index comparison. Previously, the button was only rendered for the first element in the list, but now it is rendered for the last element. This change ensures consistent rendering and improves the user experience when interacting with the component.
This commit is contained in:
parent
6359fd938b
commit
8a98f4c53d
1 changed files with 2 additions and 2 deletions
|
|
@ -31,7 +31,7 @@ export default function InputListComponent({
|
|||
<div
|
||||
className={classNames(
|
||||
value.length > 1 && editNode ? "my-1" : "",
|
||||
"flex flex-col gap-3"
|
||||
"flex flex-col gap-3",
|
||||
)}
|
||||
>
|
||||
{value.map((singleValue, idx) => {
|
||||
|
|
@ -53,7 +53,7 @@ export default function InputListComponent({
|
|||
idx
|
||||
}
|
||||
/>
|
||||
{idx === value.length - 1 ? (
|
||||
{idx === 0 ? (
|
||||
<button
|
||||
onClick={(e) => {
|
||||
let newInputList = _.cloneDeep(value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue