File tree Expand file tree Collapse file tree
plugins/global-search/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export const GroupHeader = memo(
3737 "group w-full focus:outline-none cursor-pointer text-left data-[header=normal]:absolute data-[header=normal]:left-0 data-[header=sticky]:sticky data-[header=sticky]:-top-px data-[header=sticky]:z-10 z-20" ,
3838 index === 0 && "data-[header=sticky]:top-0" ,
3939 showFadeOut &&
40- "after:content-[] after:absolute after:top-10 after:left-0 after:right-0 after:h-3 after:z-10 after:pointer-events-none after:bg-gradient-to-b after:from-modal-light dark:after:from-modal-dark after:to-transparent" ,
40+ "after:content-[] after:absolute after:top-(--header-height) after:left-0 after:right-0 after:h-3 after:z-10 after:pointer-events-none after:bg-gradient-to-b after:from-modal-light dark:after:from-modal-dark after:to-transparent" ,
4141 className
4242 ) }
4343 data-header = { isSticky ? "sticky" : "normal" }
@@ -46,12 +46,12 @@ export const GroupHeader = memo(
4646 { ...props }
4747 { ...getFocusProps ( headerId ( entry . id ) ) }
4848 >
49- < div className = "h-9 mt-1 bg-modal-light dark:bg-modal-dark" >
49+ < div className = "h-[calc(100%-5px)] mt-1 bg-modal-light dark:bg-modal-dark" >
5050 < hr
5151 className = "border-divider-light dark:border-divider-dark aria-hidden:border-modal-light dark:aria-hidden:border-modal-dark mb-1"
5252 aria-hidden = { index === 0 }
5353 />
54- < div className = "h-8 flex flex-row gap-2 rounded-lg justify-start items-center select-none overflow-hidden ps-2 group-focus-visible:bg-option-light dark:group-focus-visible:bg-option-dark group-focus-visible:text-primary-light dark:group-focus-visible:text-primary-dark" >
54+ < div className = "h-[calc(100%-10px)] flex flex-row gap-2 rounded-lg justify-start items-center select-none overflow-hidden ps-2 group-focus-visible:bg-option-light dark:group-focus-visible:bg-option-dark group-focus-visible:text-primary-light dark:group-focus-visible:text-primary-dark" >
5555 < div className = "flex-shrink-0 flex gap-2 justify-start items-center" >
5656 < IconArrowRight
5757 className = { cn (
Original file line number Diff line number Diff line change @@ -18,15 +18,21 @@ export function ResultsList({ groups }: ResultsProps) {
1818 const { virtualItems, virtualItemIds, stickyIndexes } = useProcessedResults ( groups , collapsedGroups )
1919 const { setItems } = useSelection ( )
2020
21+ const computedStyles = scrollElementRef . current ? getComputedStyle ( scrollElementRef . current ) : null
22+ const headerValue = computedStyles ?. getPropertyValue ( "--header-height" )
23+ const itemValue = computedStyles ?. getPropertyValue ( "--item-height" )
24+ const headerHeight = typeof headerValue === "string" ? Number . parseInt ( headerValue , 10 ) : null
25+ const itemHeight = typeof itemValue === "string" ? Number . parseInt ( itemValue , 10 ) : null
26+
2127 const rowVirtualizer = useVirtualizer ( {
2228 overscan : 10 ,
2329 count : virtualItems . length ,
2430 getScrollElement : ( ) => scrollElementRef . current ,
2531 estimateSize : index => {
2632 const item = virtualItems [ index ]
2733 if ( ! item ) return 0
28- if ( item . type === "group-header" ) return 50
29- return 30
34+ if ( item . type === "group-header" ) return headerHeight ?? 48
35+ return itemHeight ?? 30
3036 } ,
3137 rangeExtractor : range => {
3238 // TODO: This sticky index could be added and put into the result more efficiently
Original file line number Diff line number Diff line change 3232
3333 /* Spacing */
3434 --spacing : 5px ;
35+ --header-height : 48px ;
36+ --item-height : 30px ;
3537}
3638
3739@utility scrollbar-hidden {
You can’t perform that action at this time.
0 commit comments