mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-27 16:00:09 +08:00
fix: group tools filter and layout (#7431)
* fix(proxy): group filter * refactor(proxy): improve layout and structure of proxy render components * refactor(proxy): remove unnecessary flushSync calls in proxy-group-tools * feat(proxy): debounce filter input in ProxyGroupTools * refactor(base-search-box): initialize lastSearchStateRef with current state * refactor(proxy): remove debug console.log in proxy-groups * refactor(proxy): improve scrolling behavior in proxy groups * refactor(proxy): improve scroll position restoration logic * chore(proxy): reset proxy group tools layout * style(proxy): adjust margins and spacing in proxy components * refactor(proxy): remove commented out ProxyGroupTools component
This commit is contained in:
@@ -86,7 +86,15 @@ export const BaseSearchBox = ({
|
||||
}: SearchProps) => {
|
||||
const { t } = useTranslation()
|
||||
const onSearchRef = useRef(onSearch)
|
||||
const lastSearchStateRef = useRef<SearchState | null>(null)
|
||||
// 用初始状态初始化,使挂载时的 emitSearch 因状态相同而被跳过,
|
||||
// 从而只在输入内容真正变化时才触发 onSearch(也可避免 StrictMode 下的重复调用)。
|
||||
const lastSearchStateRef = useRef<SearchState | null>({
|
||||
text: value ?? defaultValue ?? '',
|
||||
matchCase: searchState?.matchCase ?? defaultMatchCase,
|
||||
matchWholeWord: searchState?.matchWholeWord ?? defaultMatchWholeWord,
|
||||
useRegularExpression:
|
||||
searchState?.useRegularExpression ?? defaultUseRegularExpression,
|
||||
})
|
||||
|
||||
const [text, setText] = useControllableState<string>({
|
||||
controlled: value,
|
||||
|
||||
@@ -279,10 +279,7 @@ export const StickyVirtualList = forwardRef(function StickyVirtualListInner<
|
||||
transform: `translateY(${virtualRow.start}px)`,
|
||||
width: '100%',
|
||||
zIndex: 1,
|
||||
...(isGroup && {
|
||||
opacity: 0,
|
||||
zIndex: -10,
|
||||
}),
|
||||
...(isGroup && { visibility: 'hidden' }),
|
||||
}}
|
||||
>
|
||||
{isGroup
|
||||
|
||||
Reference in New Issue
Block a user