Skip to content

Commit 1b73f14

Browse files
authored
🐛 fix(ModelSelect): resolve tooltip hover causing popup to close (#11742)
⬆️ chore: upgrade @lobehub/ui to 4.27.5 - Upgrade @lobehub/ui from 4.27.4 to 4.27.5 - Remove unused tooltip styles in ModelSelect component
1 parent c136c37 commit 1b73f14

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
"@lobehub/icons": "^4.0.2",
206206
"@lobehub/market-sdk": "0.29.1",
207207
"@lobehub/tts": "^4.0.2",
208-
"@lobehub/ui": "^4.27.4",
208+
"@lobehub/ui": "^4.27.5",
209209
"@modelcontextprotocol/sdk": "^1.25.1",
210210
"@napi-rs/canvas": "^0.1.88",
211211
"@neondatabase/serverless": "^1.0.2",

src/components/ModelSelect/index.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
} from 'lucide-react';
1515
import { type ModelAbilities } from 'model-bank';
1616
import numeral from 'numeral';
17-
import { CSSProperties, type ComponentProps, type FC, memo } from 'react';
17+
import { CSSProperties, type FC, memo } from 'react';
1818
import { useTranslation } from 'react-i18next';
1919

2020
import { type AiProviderSourceType } from '@/types/aiProvider';
@@ -51,14 +51,6 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
5151

5252
type TooltipStyles = typeof styles;
5353

54-
const DEFAULT_TOOLTIP_STYLES = {
55-
root: { pointerEvents: 'none' },
56-
} as const satisfies ComponentProps<typeof Tooltip>['styles'];
57-
58-
const FUNCTION_CALL_TOOLTIP_STYLES = {
59-
root: { maxWidth: 'unset', pointerEvents: 'none' },
60-
} as const satisfies ComponentProps<typeof Tooltip>['styles'];
61-
6254
interface ModelInfoTagsProps extends ModelAbilities {
6355
contextWindowTokens?: number | null;
6456
directionReverse?: boolean;
@@ -82,11 +74,10 @@ interface FeatureTagItemProps {
8274
icon: Parameters<typeof Icon>[0]['icon'];
8375
placement: 'top' | 'right';
8476
title: string;
85-
tooltipStyles?: ComponentProps<typeof Tooltip>['styles'];
8677
}
8778

8879
const FeatureTagItem = memo<FeatureTagItemProps>(
89-
({ className, color, enabled, icon, placement, title, tooltipStyles }) => {
80+
({ className, color, enabled, icon, placement, title }) => {
9081
if (!enabled) return null;
9182

9283
const tag = (
@@ -96,7 +87,7 @@ const FeatureTagItem = memo<FeatureTagItemProps>(
9687
);
9788

9889
return (
99-
<Tooltip placement={placement} styles={tooltipStyles ?? DEFAULT_TOOLTIP_STYLES} title={title}>
90+
<Tooltip placement={placement} title={title}>
10091
{tag}
10192
</Tooltip>
10293
);
@@ -158,7 +149,6 @@ const FeatureTags = memo<FeatureTagsProps>(
158149
icon={ToyBrick}
159150
placement={placement}
160151
title={t('ModelSelect.featureTag.functionCall')}
161-
tooltipStyles={FUNCTION_CALL_TOOLTIP_STYLES}
162152
/>
163153
<FeatureTagItem
164154
className={tagClassName}

0 commit comments

Comments
 (0)