mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-08 22:47:02 +02:00
fix: prettify scrollbar, tweak height
This commit is contained in:
@@ -120,7 +120,10 @@ export const EmojiSuggestionList = forwardRef<
|
||||
);
|
||||
}
|
||||
|
||||
const listHeight = Math.min(items.length, MAX_VISIBLE) * ITEM_HEIGHT;
|
||||
const listHeight = Math.max(
|
||||
Math.min(items.length, MAX_VISIBLE) * ITEM_HEIGHT,
|
||||
ITEM_HEIGHT + 8,
|
||||
);
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -131,10 +134,8 @@ export const EmojiSuggestionList = forwardRef<
|
||||
ref={virtuosoRef}
|
||||
totalCount={items.length}
|
||||
fixedItemHeight={ITEM_HEIGHT}
|
||||
style={{
|
||||
height: listHeight,
|
||||
overflow: items.length <= MAX_VISIBLE ? "hidden" : "auto",
|
||||
}}
|
||||
style={{ height: listHeight }}
|
||||
className="overflow-y-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-border/60 [&::-webkit-scrollbar-track]:bg-transparent"
|
||||
itemContent={renderItem}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -125,7 +125,10 @@ export const ProfileSuggestionList = forwardRef<
|
||||
);
|
||||
}
|
||||
|
||||
const listHeight = Math.min(items.length, MAX_VISIBLE) * ITEM_HEIGHT;
|
||||
const listHeight = Math.max(
|
||||
Math.min(items.length, MAX_VISIBLE) * ITEM_HEIGHT,
|
||||
ITEM_HEIGHT + 8,
|
||||
);
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -136,10 +139,8 @@ export const ProfileSuggestionList = forwardRef<
|
||||
ref={virtuosoRef}
|
||||
totalCount={items.length}
|
||||
fixedItemHeight={ITEM_HEIGHT}
|
||||
style={{
|
||||
height: listHeight,
|
||||
overflow: items.length <= MAX_VISIBLE ? "hidden" : "auto",
|
||||
}}
|
||||
style={{ height: listHeight }}
|
||||
className="overflow-y-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-border/60 [&::-webkit-scrollbar-track]:bg-transparent"
|
||||
itemContent={renderItem}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user