Skip to content

Commit 6b788fa

Browse files
authored
Merge pull request #2212 from netease-youdao/liuzhq/fix-skill-search
Liuzhq/fix skill search
2 parents b65d194 + bf1df8c commit 6b788fa

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/renderer/components/cowork/CoworkPromptInput.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,12 @@ const CoworkPromptInput = React.forwardRef<CoworkPromptInputRef, CoworkPromptInp
14651465
clearTimeout(skillSubmenuCloseTimerRef.current);
14661466
}
14671467
skillSubmenuCloseTimerRef.current = setTimeout(() => {
1468+
const activeElement = document.activeElement;
1469+
if (activeElement && addMenuRef.current?.contains(activeElement)) {
1470+
logPromptModelSelection('debug', 'kept skill submenu open because focus remains inside prompt tools menu');
1471+
skillSubmenuCloseTimerRef.current = null;
1472+
return;
1473+
}
14681474
setShowSkillsPopover(false);
14691475
skillSubmenuCloseTimerRef.current = null;
14701476
}, 120);

src/renderer/components/skills/SkillsPopover.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ const SkillsPopover: React.FC<SkillsPopoverProps> = ({
144144
const listClassName = asSubmenu
145145
? 'overflow-y-auto px-2 py-1.5'
146146
: 'overflow-y-auto py-1';
147-
const listStyle: React.CSSProperties = { maxHeight: `${maxListHeight}px` };
147+
const listStyle: React.CSSProperties = asSubmenu
148+
? { height: `${maxListHeight}px` }
149+
: { maxHeight: `${maxListHeight}px` };
148150
const emptyStateClassName = asSubmenu
149151
? 'flex h-[50px] items-center justify-center px-3 text-center text-[13px] leading-5 text-secondary'
150152
: 'px-4 py-6 text-center text-sm text-secondary';

0 commit comments

Comments
 (0)