diff --git a/src/renderer/src/pages/home/Inputbar/MentionModelsButton.tsx b/src/renderer/src/pages/home/Inputbar/MentionModelsButton.tsx index 83be3741..c4aff997 100644 --- a/src/renderer/src/pages/home/Inputbar/MentionModelsButton.tsx +++ b/src/renderer/src/pages/home/Inputbar/MentionModelsButton.tsx @@ -271,20 +271,16 @@ const MentionModelsButton: FC = ({ mentionModels, onMentionModel: onSelec
{group.label}
- {group.children.map((item, idx) => { - // calculate item global idx - const index = startIndex + idx - return ( -
setItemRef(index, el)} - className={`ant-dropdown-menu-item ${selectedIndex === index ? 'ant-dropdown-menu-item-selected' : ''}`} - onClick={item.onClick}> - {item.icon} - {item.label} -
- ) - })} + {group.children.map((item, idx) => ( +
setItemRef(startIndex + idx, el)} + className={`ant-dropdown-menu-item ${selectedIndex === startIndex + idx ? 'ant-dropdown-menu-item-selected' : ''}`} + onClick={item.onClick}> + {item.icon} + {item.label} +
+ ))}
)