fix: prevent collapse button from overlapping expanded content in next-search (#17157)

This commit is contained in:
euvre
2026-07-22 14:56:20 +08:00
committed by GitHub
parent 18ea0fb7f9
commit ff1274895f

View File

@@ -84,25 +84,25 @@ export default function ExpandableContent({
<div className="absolute bottom-0 left-0 right-0 h-20 bg-gradient-to-t from-bg-base to-transparent pointer-events-none" />
)}
{isOverflowing && (
{isOverflowing && !isExpanded && (
<Button
size="sm"
onClick={toggleExpand}
className="absolute bottom-2 left-1/2 -translate-x-1/2"
>
{isExpanded ? (
<>
<ChevronUp size={14} />
<span>{t('common.viewLess')}</span>
</>
) : (
<>
<ChevronDown size={14} />
<span>{t('common.viewMore')}</span>
</>
)}
<ChevronDown size={14} />
<span>{t('common.viewMore')}</span>
</Button>
)}
{isOverflowing && isExpanded && (
<div className="flex justify-center pt-2">
<Button size="sm" onClick={toggleExpand}>
<ChevronUp size={14} />
<span>{t('common.viewLess')}</span>
</Button>
</div>
)}
</div>
);
}