Skip to content

Commit 528383a

Browse files
committed
fix: copilotkit click ask to close popup
1 parent 0daa163 commit 528383a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/frontend/src/components/layout/click.outside.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import { useEffect } from 'react';
33
export const useClickOutside = (callback: () => Promise<void>) => {
44
const handleClick = (event: MouseEvent) => {
55
const selector = document.querySelector('#add-edit-modal');
6-
if (selector && !selector.contains(event.target as HTMLElement)) {
6+
const copilotkit = document.querySelector('.copilotKitPopup');
7+
if (
8+
selector &&
9+
!selector.contains(event.target as HTMLElement) &&
10+
copilotkit &&
11+
!copilotkit.contains(event.target as HTMLElement)
12+
) {
713
callback();
814
}
915
};

0 commit comments

Comments
 (0)