fix(proxy-groups): restrict reduced-height viewport to chain-mode column

This commit is contained in:
Slinetrac
2025-10-24 21:57:01 +08:00
Unverified
parent 89d7c7c3e5
commit f79c2bfdff

View File

@@ -381,16 +381,16 @@ export const ProxyGroups = (props: Props) => {
return Array.from(new Set(names));
}, [renderList]);
const virtuosoHeight =
mode === "rule" && proxyGroupNames.length > 0
? "calc(100% - 80px)"
: "calc(100% - 14px)";
if (mode === "direct") {
return <BaseEmpty text={t("clash_mode_direct")} />;
}
if (isChainMode) {
const chainVirtuosoHeight =
mode === "rule" && proxyGroupNames.length > 0
? "calc(100% - 80px)"
: "calc(100% - 14px)";
// 获取所有代理组
const proxyGroups = proxiesData?.groups || [];
@@ -469,7 +469,7 @@ export const ProxyGroups = (props: Props) => {
<Virtuoso
ref={virtuosoRef}
style={{
height: virtuosoHeight,
height: chainVirtuosoHeight,
}}
totalCount={renderList.length}
increaseViewportBy={{ top: 200, bottom: 200 }}
@@ -609,7 +609,7 @@ export const ProxyGroups = (props: Props) => {
<Virtuoso
ref={virtuosoRef}
style={{ height: virtuosoHeight }}
style={{ height: "calc(100% - 14px)" }}
totalCount={renderList.length}
increaseViewportBy={{ top: 200, bottom: 200 }}
overscan={150}