fix: copilotkit click ask to close popup
This commit is contained in:
parent
0daa163151
commit
528383a71d
|
|
@ -3,7 +3,13 @@ import { useEffect } from 'react';
|
|||
export const useClickOutside = (callback: () => Promise<void>) => {
|
||||
const handleClick = (event: MouseEvent) => {
|
||||
const selector = document.querySelector('#add-edit-modal');
|
||||
if (selector && !selector.contains(event.target as HTMLElement)) {
|
||||
const copilotkit = document.querySelector('.copilotKitPopup');
|
||||
if (
|
||||
selector &&
|
||||
!selector.contains(event.target as HTMLElement) &&
|
||||
copilotkit &&
|
||||
!copilotkit.contains(event.target as HTMLElement)
|
||||
) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue